mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Docs: Clarify the before_and_after() example (GH-28458)
This commit is contained in:
parent
a6779715c4
commit
fcbf9b176b
2 changed files with 8 additions and 6 deletions
|
@ -2646,10 +2646,11 @@ True
|
|||
>>> list(odds)
|
||||
[1, 3, 5, 7, 9]
|
||||
|
||||
>>> all_upper, remainder = before_and_after(str.isupper, 'ABCdEfGhI')
|
||||
>>> str.join('', all_upper)
|
||||
>>> it = iter('ABCdEfGhI')
|
||||
>>> all_upper, remainder = before_and_after(str.isupper, it)
|
||||
>>> ''.join(all_upper)
|
||||
'ABC'
|
||||
>>> str.join('', remainder)
|
||||
>>> ''.join(remainder)
|
||||
'dEfGhI'
|
||||
|
||||
>>> list(powerset([1,2,3]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue