[issue10109] itertools.product with infinite iterator cause MemoryError.

2016-09-17 Thread Lucas Wiman
Lucas Wiman added the comment: It is quite thrifty with memory compared to the size of the search space O(n*k) memory for a search space of size O(n**k). I think a reasonable expectation for itertools.product is that it should _eventually_ reach any element in the search space. The only way

[issue10109] itertools.product with infinite iterator cause MemoryError.

2016-05-31 Thread Lucas Wiman
Lucas Wiman added the comment: I realize this is an old (and closed!) thread, but here are a few notes from running into this issue recently, working on a search problem with infinite iterators. First, note that yegle's recursive solution is not correct, since it exhausts the iterators