Skip to content

Commit e4cc3a7

Browse files
bpo-40806: itertools.product immediately consumes its inputs (GH-20492) (GH-20498)
1 parent eceee54 commit e4cc3a7

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)