This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients Dennis Sweeney, Henry Carscadden, rhettinger, tim.peters
Date 2020-04-10.04:51:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Henry, I have to ask again:  please give at least one specific, concrete example of the behavior you're objecting to.  English isn't helping, and I still have no idea what your complaint is.

What I'm looking for:

    for i in itertools.product(???):
where you replace the ??? with executable code (preferably not using numpy or any other extension package) that provokes the MemoryError you're talking about.

For example, here I'm constructing a case with a million arguments.  There's no problem at all:

>>> import itertools
>>> args = [range(100) for i in range(1_000_000)]
>>> for i in itertools.product(*args):
...     print(len(i))
[and it prints 1000000 over & over until I get bored and kill it]

Note if it _did_ provoke a problem, we probably wouldn't care - there are no plausible realistic use cases for passing a million arguments to product().

You haven't given us a way to reproduce your complaint, or even a clue as to the number of arguments you're talking about.  The above code was my best guess as to what you _might_ be talking about.  But since there's no MemoryError in sight, apparently not.

I'm suspecting this may be an XY problem[1], and especially because you posted "a solution" instead of an actual problem ;-)

Date User Action Args
2020-04-10 04:51:44tim.peterssetrecipients: + tim.peters, rhettinger, Dennis Sweeney, Henry Carscadden
2020-04-10 04:51:44tim.peterssetmessageid: <>
2020-04-10 04:51:44tim.peterslinkissue40230 messages
2020-04-10 04:51:44tim.peterscreate