diff options
| author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2021-09-19 19:52:27 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-19 19:52:27 -0500 |
| commit | fcbf9b176b1190301c760a921601c6488ef8b070 (patch) | |
| tree | 5147e2be97e18e04fff0293016f61c1de66c872c /Lib/test/test_itertools.py | |
| parent | a6779715c4d0289acb59a8fd3660ab2e5d486c4b (diff) | |
| download | cpython-git-fcbf9b176b1190301c760a921601c6488ef8b070.tar.gz | |
Docs: Clarify the before_and_after() example (GH-28458)
Diffstat (limited to 'Lib/test/test_itertools.py')
| -rw-r--r-- | Lib/test/test_itertools.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index db6a98351b..4e1dd02550 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -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])) |
