Skip to content

Commit cfc6ce4

Browse files
authored
bpo-40806: Clarify that itertools.product immediately consumes its inpt (GH-20492)
1 parent 242d956 commit cfc6ce4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Doc/library/itertools.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,9 @@ loops that truncate the stream.
563563
for prod in result:
564564
yield tuple(prod)
565565

566+
Before :func:`product` runs, it completely consumes the input iterables,
567+
keeping pools of values in memory to generate the products. Accordingly,
568+
it only useful with finite inputs.
566569

567570
.. function:: repeat(object[, times])
568571

0 commit comments

Comments
 (0)