[3.12] gh-116842: Improve test comment and fix a doctest (gh-116846) (gh-116847)

This commit is contained in:
Miss Islington (bot) 2024-03-15 03:46:54 +01:00 committed by GitHub
parent e4ec445926
commit 37514111be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1405,7 +1405,7 @@ The following recipes have a more mathematical flavor:
[1, 4] [1, 4]
>>> # Verify faithfulness to type specific index() method behaviors. >>> # Verify faithfulness to type specific index() method behaviors.
>>> # For example, bytes and str perform subsequence searches >>> # For example, bytes and str perform continuous-subsequence searches
>>> # that do not match the general behavior specified >>> # that do not match the general behavior specified
>>> # in collections.abc.Sequence.index(). >>> # in collections.abc.Sequence.index().
>>> seq = 'abracadabra' >>> seq = 'abracadabra'
@ -1556,7 +1556,7 @@ The following recipes have a more mathematical flavor:
>>> list(roundrobin('abc', 'd', 'ef')) >>> list(roundrobin('abc', 'd', 'ef'))
['a', 'd', 'e', 'b', 'f', 'c'] ['a', 'd', 'e', 'b', 'f', 'c']
>>> ranges = [range(5, 1000), range(4, 3000), range(0), range(3, 2000), range(2, 5000), range(1, 3500)] >>> ranges = [range(5, 1000), range(4, 3000), range(0), range(3, 2000), range(2, 5000), range(1, 3500)]
>>> collections.Counter(roundrobin(ranges)) == collections.Counter(ranges) >>> collections.Counter(roundrobin(*ranges)) == collections.Counter(chain(*ranges))
True True
>>> # Verify that the inputs are consumed lazily >>> # Verify that the inputs are consumed lazily
>>> input_iterators = list(map(iter, ['abcd', 'ef', '', 'ghijk', 'l', 'mnopqr'])) >>> input_iterators = list(map(iter, ['abcd', 'ef', '', 'ghijk', 'l', 'mnopqr']))