From 9f925364412093381f50c0ca48f50d249da939c2 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 16 Dec 2015 22:20:54 -0500 Subject: Clean-up documentation to use NumPy style docs on remaining classes. --- discord/utils.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'discord/utils.py') diff --git a/discord/utils.py b/discord/utils.py index 9e230262..1629a454 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -58,15 +58,20 @@ def find(predicate, seq): member = find(lambda m: m.name == 'Mighty', channel.server.members) would find the first :class:`Member` whose name is 'Mighty' and return it. + If an entry is not found, then ``None`` is returned. This is different from `filter`_ due to the fact it stops the moment it finds a valid entry. + .. _filter: https://docs.python.org/3.6/library/functions.html#filter - :param predicate: A function that returns a boolean-like result. - :param seq: The sequence to iterate through. - :return: The first result of the predicate that returned a ``True``-like value or ``None`` if nothing was found. + Parameters + ----------- + predicate + A function that returns a boolean-like result. + seq : iterable + The iterable to search through. """ for element in seq: -- cgit v1.2.3