Skip to content

Commit

Permalink
Really one more tweak for locate() docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
bbayles committed May 21, 2017
1 parent c1c22c4 commit 24a93ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions more_itertools/more.py
Expand Up @@ -1308,13 +1308,13 @@ def locate(iterable, pred=bool):
"""Yield the index of each item in *iterable* for which *pred* returns
``True``.
*pred* defaults to ``bool``, which will select truthy items:
*pred* defaults to :func:`bool`, which will select truthy items:
>>> list(locate([0, 1, 1, 0, 1, 0, 0]))
[1, 2, 4]
Set *pred* to a custom function to, e.g., find the indexes for a particular
item.
item:
>>> list(locate(['a', 'b', 'c', 'b'], lambda x: x == 'b'))
[1, 3]
Expand Down

0 comments on commit 24a93ea

Please sign in to comment.