But that's in Phyton is it exactly the same for SAGE?

2011/1/9 Iwao Kimura <[email protected]>

> Hi, Trollkemada,
>
> Here is the same question (and answers):
>
> http://stackoverflow.com/questions/1271320/reseting-generator-object-in-python
>
> Hope this helps.
>
> On Sun, Jan 9, 2011 at 10:55 PM, Trollkemada <[email protected]>
> wrote:
> > Hi,
> >
> > 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?
> >
> > I know that there is not .reset() or something like that, and that
> > this operation can not make sense for some generators. But i mean, how
> > to reinizializate those kind of generator which are like the one I
> > tiped above.
> >
> > 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.
> >
> > Thanks ;)
> >
> > P.D. Sorry about my english :-P
> >
> > --
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> [email protected]<sage-support%[email protected]>
> > For more options, visit this group at
> http://groups.google.com/group/sage-support
> > URL: http://www.sagemath.org
> >
>
>
>
> --
> ---
> Iwao KIMURA
> Dept. Math., University of Toyama, Japan.
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<sage-support%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
Empieza a ganar dinero facilmente desde casa, sólo leyendo publicidad :D

Apúntate --> http://www.es-facil.com/ganar/alta?Id=65269775

(Si tienes algún problema o duda no dudes en consultarme :D)

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to