Tim Peters <t...@python.org> added the comment:

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(???):
        pass
 
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 ;-)

[1] https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40230>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to