From cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa Mon Sep 17 00:00:00 2001 From: Ramil Nugmanov Date: Thu, 28 May 2020 19:46:22 +0300 Subject: [PATCH] bpo-40806: Clarify that itertools.product immediately consumes its inpt (GH-20492) --- Doc/library/itertools.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 3e5a6738981..3c94c4b35dc 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -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])