mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #10323: Predictable final state for slice().
This commit is contained in:
parent
ac9a2bb067
commit
69b34bfe9c
3 changed files with 13 additions and 3 deletions
|
@ -788,6 +788,11 @@ class TestBasicOps(unittest.TestCase):
|
|||
self.assertRaises(ValueError, islice, range(10), 1, 'a', 1)
|
||||
self.assertEqual(len(list(islice(count(), 1, 10, maxsize))), 1)
|
||||
|
||||
# Issue #10323: Less islice in a predictable state
|
||||
c = count()
|
||||
self.assertEqual(list(islice(c, 1, 3, 50)), [1])
|
||||
self.assertEqual(next(c), 3)
|
||||
|
||||
def test_takewhile(self):
|
||||
data = [1, 3, 5, 20, 2, 4, 6, 8]
|
||||
underten = lambda x: x<10
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue