mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Added optional None arguments to itertools.islice().
This commit is contained in:
parent
d2f70cbe8e
commit
b2594050ea
4 changed files with 27 additions and 14 deletions
|
@ -260,6 +260,8 @@ class TestBasicOps(unittest.TestCase):
|
|||
|
||||
# Test stop=None
|
||||
self.assertEqual(list(islice(xrange(10), None)), range(10))
|
||||
self.assertEqual(list(islice(xrange(10), None, None)), range(10))
|
||||
self.assertEqual(list(islice(xrange(10), None, None, None)), range(10))
|
||||
self.assertEqual(list(islice(xrange(10), 2, None)), range(2, 10))
|
||||
self.assertEqual(list(islice(xrange(10), 1, None, 2)), range(1, 10, 2))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue