8000 bpo-42450 Minor updates to the itertools recipes by rhettinger · Pull Request #23555 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-42450 Minor updates to the itertools recipes #23555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 29, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update the tests to match the new name for pad_none
  • Loading branch information
rhettinger committed Nov 29, 2020
commit 09de2c2f64c6b29fc8b5dd32305506ab98a96098
4 changes: 2 additions & 2 deletions Lib/test/test_itertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ def test_permutations_sizeof(self):
... "Count how many times the predicate is true"
... return sum(map(pred, iterable))

>>> def padnone(iterable):
>>> def pad_none(iterable):
... "Returns the sequence elements and then returns None indefinitely"
... return chain(iterable, repeat(None))

Expand Down Expand Up @@ -2460,7 +2460,7 @@ def test_permutations_sizeof(self):
>>> list(pairwise('a'))
[]

>>> list(islice(padnone('abc'), 0, 6))
>>> list(islice(pad_none('abc'), 0, 6))
['a', 'b', 'c', None, None, None]

>>> list(ncycles('abc', 3))
Expand Down
0