bpo-40806: Clarify that itertools.product immediately consumes its inpt (GH-20492)

This commit is contained in:
Ramil Nugmanov 2020-05-28 19:46:22 +03:00 committed by GitHub
parent 242d95659b
commit cfc6ce4d40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -563,6 +563,9 @@ loops that truncate the stream.
for prod in result:
yield tuple(prod)
Before :func:`product` runs, it completely consumes the input iterables,
keeping pools of values in memory to generate the products. Accordingly,
it only useful with finite inputs.
.. function:: repeat(object[, times])