Resetting generator object in Python
I have a generator object returned by multiple yield. Preparation to call this generator is rather time-consuming operation. That is why I want to reuse the generator several times. y = FunctionWithYield() for x in y: print(x) #here must be something to reset ‘y’ for x in y: print(x) Of course, I’m taking in mind … Read more