summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-02-29 02:21:48 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-02-29 02:21:48 (GMT)
commit08ff6822cc64497a27aba9d84b3a51b706f01221 (patch)
tree665233f7597517a7ea34cae38169746c2dfdfbe0 /Lib
parent1ddf1d8482f4fd8ae034bfd0221696ee2068c144 (diff)
downloadcpython-08ff6822cc64497a27aba9d84b3a51b706f01221.zip
cpython-08ff6822cc64497a27aba9d84b3a51b706f01221.tar.gz
cpython-08ff6822cc64497a27aba9d84b3a51b706f01221.tar.bz2
Handle the repeat keyword argument for itertools.product().
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_itertools.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 500afef..087570c 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -296,6 +296,9 @@ class TestBasicOps(unittest.TestCase):
([range(2), range(3), range(0)], []), # last iterable with zero length
]:
self.assertEqual(list(product(*args)), result)
+ for r in range(4):
+ self.assertEqual(list(product(*(args*r))),
+ list(product(*args, **dict(repeat=r))))
self.assertEqual(len(list(product(*[range(7)]*6))), 7**6)
self.assertRaises(TypeError, product, range(6), None)
argtypes = ['', 'abc', '', xrange(0), xrange(4), dict(a=1, b=2, c=3),