summaryrefslogtreecommitdiffstats
path: root/Modules/itertoolsmodule.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-02-10 02:41:10 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-02-10 02:41:10 (GMT)
commita86f2c06fd08e8aebf3641c1ad2d234425b90c55 (patch)
tree0780de78edaaf79a9dbe66d7b2011a8cbb4c9ddd /Modules/itertoolsmodule.c
parent3a409e91d80b754699c9522217d70abd28d6f4f1 (diff)
downloadcpython-a86f2c06fd08e8aebf3641c1ad2d234425b90c55.zip
cpython-a86f2c06fd08e8aebf3641c1ad2d234425b90c55.tar.gz
cpython-a86f2c06fd08e8aebf3641c1ad2d234425b90c55.tar.bz2
Merged revisions 69466,69480 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r69466 | raymond.hettinger | 2009-02-09 12:39:41 -0600 (Mon, 09 Feb 2009) | 3 lines Issue 5171: itertools.product docstring missing 'repeat' argument ........ r69480 | raymond.hettinger | 2009-02-09 19:24:05 -0600 (Mon, 09 Feb 2009) | 1 line Issue 1818: collections.namedtuple() to support automatic renaming of invalid fieldnames. ........
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r--Modules/itertoolsmodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 58c30f9..9245b1f 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1791,6 +1791,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) ...");