Incremental Combination Generation from Laggy Generators

It looks like the problem is that itertools.product fully consumes its iterables before it starts to yield results. I found a discussion from a few years ago about adding another function that would yield results incrementally, but it doesn’t look like it went anywhere. You might could look at the suggested implementation and see if it would work for you, or it was also noted that sympy has a function that can do this.

In general, though, I think the answer is that there isn’t a particular design pattern that you’re missing. If itertools doesn’t quite work the way you need it to, you may need to write your own version of its functions, or find other implementations that do work for you.