summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-02-21 22:30:12 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-02-21 22:30:12 (GMT)
commiteb13fdda59e470468171319f4bbf813494226ddf (patch)
tree240e402292af415612328d32ad9450744f4494b3 /Lib/test/test_itertools.py
parentbd171bcfc416c71d2f5e3615f6a064dc2737e09b (diff)
downloadcpython-eb13fdda59e470468171319f4bbf813494226ddf.zip
cpython-eb13fdda59e470468171319f4bbf813494226ddf.tar.gz
cpython-eb13fdda59e470468171319f4bbf813494226ddf.tar.bz2
Port r69837: Fix keyword arguments for itertools.count(). Step arg without a start arg was ignored.
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index cf0ca24..af2efa0 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -354,6 +354,10 @@ class TestBasicOps(unittest.TestCase):
def test_count_with_stride(self):
self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)])
+ self.assertEqual(lzip('abc',count(start=2,step=3)),
+ [('a', 2), ('b', 5), ('c', 8)])
+ self.assertEqual(lzip('abc',count(step=-1)),
+ [('a', 0), ('b', -1), ('c', -2)])
self.assertEqual(lzip('abc',count(2,0)), [('a', 2), ('b', 2), ('c', 2)])
self.assertEqual(lzip('abc',count(2,1)), [('a', 2), ('b', 3), ('c', 4)])
self.assertEqual(lzip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)])