diff options
| author | Rapptz <[email protected]> | 2015-12-16 22:20:54 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-12-16 22:20:54 -0500 |
| commit | 9f925364412093381f50c0ca48f50d249da939c2 (patch) | |
| tree | 7461113e4b5f734a793e7c66d4ed217da9421d73 /discord/utils.py | |
| parent | Make more things into properties. (diff) | |
| download | discord.py-9f925364412093381f50c0ca48f50d249da939c2.tar.xz discord.py-9f925364412093381f50c0ca48f50d249da939c2.zip | |
Clean-up documentation to use NumPy style docs on remaining classes.
Diffstat (limited to 'discord/utils.py')
| -rw-r--r-- | discord/utils.py | 11 |
1 files changed, 8 insertions, 3 deletions
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: |