]> granicus.if.org Git - python/commitdiff
Issue 5171: itertools.product docstring missing 'repeat' argument
authorRaymond Hettinger <python@rcn.com>
Mon, 9 Feb 2009 18:39:41 +0000 (18:39 +0000)
committerRaymond Hettinger <python@rcn.com>
Mon, 9 Feb 2009 18:39:41 +0000 (18:39 +0000)
Modules/itertoolsmodule.c

index fac395f09c5aa349929ca039ebea3f01a24ee676..486c2e0a591608f44e5ce3e5a6ed8c3d83d15cb5 100644 (file)
@@ -1970,6 +1970,9 @@ For example, product(A, B) returns the same as:  ((x,y) for x in A for y in B).\
 The leftmost iterators are in the outermost for-loop, so the output tuples\n\
 cycle in a manner similar to an odometer (with the rightmost element changing\n\
 on every iteration).\n\n\
+To compute the product of an iterable with itself, specify the number\n\
+of repetitions with the optional repeat keyword argument. For example,\n\
+product(A, repeat=4) means the same as product(A, A, A, A).\n\n\
 product('ab', range(3)) --> ('a',0) ('a',1) ('a',2) ('b',0) ('b',1) ('b',2)\n\
 product((0,1), (0,1), (0,1)) --> (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ...");