[New-bugs-announce] [issue46379] itertools.product reference implementation creates temporaries
Markus Wallerberger
report at bugs.python.org
Fri Jan 14 12:41:54 EST 2022
New submission from Markus Wallerberger <markus.wallerberger at tuwien.ac.at>:
The reference implementation of itertools.product creates large temporaries, which we need to remind people of at the top of the code block.
However, using generator magic, we don't need to do this and can even simplify the code in the process! Basically,we iterate over a generator of product(*seq[:-1]), and extend each of the values by every value in seq[-1].
----------
assignee: docs at python
components: Documentation
messages: 410573
nosy: docs at python, mwallerb
priority: normal
severity: normal
status: open
title: itertools.product reference implementation creates temporaries
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46379>
_______________________________________
More information about the New-bugs-announce
mailing list