How to reinitialize a generator.
I would like to know how to reinitialize/reset a generator. I mean, if I for example have:
sage: generator = (n for n in range(1,10000) if (is_prime(n) & is_prime(n+2)))
And then i run
generator.next() for example twice. How can i reinitialize/rest this generator so that when i run
generator.next() again i get the first element?
If it is possible, i would thank you a lot if you can link the documentation file with the info, because i have searching for it so long and I didn't find anything.
P.D. Maybe my english is not good enought and i misspelled some words. Sorry about that.