Using itertools.product and want to seed a value
here’s a solution based on pypy’s library code (thanks to agf’s suggestion in the comments). the state is available via the .state attribute and can be reset via .goto(state) where state is an index into the sequence (starting at 0). there’s a demo at the end (you need to scroll down, i’m afraid). this is … Read more