summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-09-20 01:53:37 (GMT)
committerGitHub <noreply@github.com>2021-09-20 01:53:37 (GMT)
commit697b6650ed29cdd4c347e9d35c43e084eff22c5f (patch)
tree21371b06a59813b72c1109355e44861b85500083 /Lib/test/test_itertools.py
parent0e9608680525b120fc8eaad9f1cb2f729a6c22ae (diff)
downloadcpython-697b6650ed29cdd4c347e9d35c43e084eff22c5f.zip
cpython-697b6650ed29cdd4c347e9d35c43e084eff22c5f.tar.gz
cpython-697b6650ed29cdd4c347e9d35c43e084eff22c5f.tar.bz2
Docs: Clarify the before_and_after() example (GH-28458) (#28464)
(cherry picked from commit fcbf9b176b1190301c760a921601c6488ef8b070) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com> Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index aa81076..a12f6f0 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -2605,10 +2605,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]))