[issue40230] Itertools.product() Out of Memory Errors

2020-04-10 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> not a bug stage: test needed -> resolved status: open -> closed ___ Python tracker ___

[issue40230] Itertools.product() Out of Memory Errors

2020-04-10 Thread Henry Carscadden
Henry Carscadden added the comment: Tim, I'm guessing it was a misdiagnosis then. In any case, something changed about my codebase that alleviated the problem. Thanks for looking into it. -- ___ Python tracker

[issue40230] Itertools.product() Out of Memory Errors

2020-04-10 Thread Tim Peters
Tim Peters added the comment: Henry, no, I see no problem while running your example. It's been running on my box for over 5 minutes now, and memory use remains trivial. Note that in the code I posted for you, instead of [1, 2] I used range(100), and instead of 50 I used a million: the sam

[issue40230] Itertools.product() Out of Memory Errors

2020-04-10 Thread Henry Carscadden
Henry Carscadden added the comment: @Tim Peters For example, the following should reproduce the error: many_arguments = [[1,2] for i in range(50)] for term in product(*many_arguments): print(term) In my application, I was taking the Cartesian product of the sets of all simple path to sever

[issue40230] Itertools.product() Out of Memory Errors

2020-04-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: > when I moved to testing on non-trivial graphs, I immediately had > Out of Memory Errors. I'm going to hazard a guess that the input to product() was a graph traversal iterator that got trapped in an undetected cycle. Feeding an infinite iterator into

[issue40230] Itertools.product() Out of Memory Errors

2020-04-09 Thread Tim Peters
Tim Peters 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(???): pas

[issue40230] Itertools.product() Out of Memory Errors

2020-04-09 Thread Henry Carscadden
Henry Carscadden added the comment: Hey, Tim, I just wanted a note of clarification. I was working on an approximation algorithm for a network science tool that is being released soon. Initially, I relied on itertools.product(), but when I moved to testing on non-trivial graphs, I immediatel

[issue40230] Itertools.product() Out of Memory Errors

2020-04-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue40230] Itertools.product() Out of Memory Errors

2020-04-08 Thread Tim Peters
Tim Peters added the comment: Possibly related: https://bugs.python.org/issue10109 Henry, I'm not clear at all about what you're saying. Please give at least one specific, concrete example of the behavior you're objecting to, and specify the behavior you want to see instead. -

[issue40230] Itertools.product() Out of Memory Errors

2020-04-08 Thread Dennis Sweeney
Change by Dennis Sweeney : -- versions: +Python 3.9 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue40230] Itertools.product() Out of Memory Errors

2020-04-08 Thread Dennis Sweeney
Dennis Sweeney added the comment: The trouble is that itertools.product accepts iterators, and there is no guaranteed way of "restarting" an arbitrary iterator in Python. Consider: >>> a = iter([1,2,3]) >>> b = iter([4,5,6]) >>> next(a) 1 >>> next(b) 4 >>> from ite

[issue40230] Itertools.product() Out of Memory Errors

2020-04-08 Thread Zachary Ware
Change by Zachary Ware : -- components: +Library (Lib) -Distutils nosy: +rhettinger -dstufft, eric.araujo stage: -> test needed ___ Python tracker ___

[issue40230] Itertools.product() Out of Memory Errors

2020-04-08 Thread Henry Carscadden
New submission from Henry Carscadden : The product method in itertools provides an implementation of the Cartesian product that when run on with many arguments quickly gives out of memory errors. The current implementation creates a lot of unnecessary lists in this situation. A more appropria