From 539692c7fae20f95840786477ca59df68c84789f Mon Sep 17 00:00:00 2001 From: stsouko Date: Thu, 28 May 2020 18:30:04 +0300 Subject: [PATCH 1/4] explanation --- Doc/library/itertools.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 3e5a673898106c..1bfd7a086f745e 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) + Note, ``product`` expect its arguments to be finite iterables. + It keep all their elements in memory to produce all possible pairs. + For this reason ``product`` may require significant auxiliary storage (depending on lengths of iterables). .. function:: repeat(object[, times]) From 7f5411b197b96ad05272edf77bfc0c552aa8ad2e Mon Sep 17 00:00:00 2001 From: stsouko Date: Thu, 28 May 2020 18:47:54 +0300 Subject: [PATCH 2/4] moved to newline. --- Doc/library/itertools.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 1bfd7a086f745e..edbef5f4f25184 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -565,7 +565,8 @@ loops that truncate the stream. Note, ``product`` expect its arguments to be finite iterables. It keep all their elements in memory to produce all possible pairs. - For this reason ``product`` may require significant auxiliary storage (depending on lengths of iterables). + For this reason ``product`` may require significant auxiliary storage + (depending on lengths of iterables). .. function:: repeat(object[, times]) From 59880a7d7ebd8ec3ed06a825159aa3909ac8b5a4 Mon Sep 17 00:00:00 2001 From: stsouko Date: Thu, 28 May 2020 19:08:43 +0300 Subject: [PATCH 3/4] reformatted due to autotesting failed --- Doc/library/itertools.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index edbef5f4f25184..39dd532cabdaf6 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -563,9 +563,9 @@ loops that truncate the stream. for prod in result: yield tuple(prod) - Note, ``product`` expect its arguments to be finite iterables. + Note, this function expect its arguments to be finite iterables. It keep all their elements in memory to produce all possible pairs. - For this reason ``product`` may require significant auxiliary storage + For this reason :func:`product` may require significant auxiliary storage (depending on lengths of iterables). .. function:: repeat(object[, times]) From b9fcccbc1d645c397c6082e0fbe9ad8815ae4c87 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Thu, 28 May 2020 09:30:03 -0700 Subject: [PATCH 4/4] * Fix bad markup which was being rejected by the buildbots. * Switch to an affirmative tone as required by the dev guide. --- Doc/library/itertools.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 39dd532cabdaf6..3c94c4b35dc0e5 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -563,10 +563,9 @@ loops that truncate the stream. for prod in result: yield tuple(prod) - Note, this function expect its arguments to be finite iterables. - It keep all their elements in memory to produce all possible pairs. - For this reason :func:`product` may require significant auxiliary storage - (depending on lengths of iterables). + 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])