mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Important usability fix in itertools documentation.
This commit is contained in:
parent
291f14e3d3
commit
88821f7c20
1 changed files with 3 additions and 3 deletions
|
|
@ -348,15 +348,15 @@ from building blocks.
|
|||
|
||||
>>> def all(pred, seq):
|
||||
... "Returns True if pred(x) is True for every element in the iterable"
|
||||
... return not nth(ifilterfalse(pred, seq), 0)
|
||||
... return False not in imap(pred, seq)
|
||||
|
||||
>>> def some(pred, seq):
|
||||
... "Returns True if pred(x) is True at least one element in the iterable"
|
||||
... return bool(nth(ifilter(pred, seq), 0))
|
||||
... return True in imap(pred, seq)
|
||||
|
||||
>>> def no(pred, seq):
|
||||
... "Returns True if pred(x) is False for every element in the iterable"
|
||||
... return not nth(ifilter(pred, seq), 0)
|
||||
... return True not in imap(pred, seq)
|
||||
|
||||
>>> def padnone(seq):
|
||||
... "Returns the sequence elements and then returns None indefinitely"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue