mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #10323: Predictable final state for slice().
This commit is contained in:
parent
1fea5c4472
commit
061bf7a11a
3 changed files with 13 additions and 3 deletions
|
@ -778,6 +778,11 @@ class TestBasicOps(unittest.TestCase):
|
|||
self.assertRaises(ValueError, islice, xrange(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