diff options
| author | Raymond Hettinger <python@rcn.com> | 2009-02-21 22:30:12 +0000 |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2009-02-21 22:30:12 +0000 |
| commit | eb13fdda59e470468171319f4bbf813494226ddf (patch) | |
| tree | 240e402292af415612328d32ad9450744f4494b3 /Lib | |
| parent | bd171bcfc416c71d2f5e3615f6a064dc2737e09b (diff) | |
| download | cpython-git-eb13fdda59e470468171319f4bbf813494226ddf.tar.gz | |
Port r69837: Fix keyword arguments for itertools.count(). Step arg without a start arg was ignored.
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/test/test_itertools.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index cf0ca24d27..af2efa0087 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)]) |
