Thanks. (Re: keeping state in an iterator object by rebinding next())

2008-03-20 Thread Wilbert Berendsen
Thanks for all the elaborate answers and help! It helped me deepening my understanding of Python. Sincere, Wilbert Berendsen -- http://www.wilbertberendsen.nl/ "You must be the change you wish to see in the world." -- Mahatma Gandhi -- http://mail.python.org/mailman/listinfo/python-list

Re: keeping state in an iterator object by rebinding next()

2008-03-19 Thread iteration . nth
On Mar 19, 3:36 pm, Wilbert Berendsen <[EMAIL PROTECTED]> wrote: > Hi, > > i am writing a simple parser, that generates tokens. The parser needs to > maintain some state, because some parts of the file consist of different > tokens. I thought the object could simply remember its state by assigning

Re: keeping state in an iterator object by rebinding next()

2008-03-19 Thread Terry Reedy
"Wilbert Berendsen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi, | | i am writing a simple parser, that generates tokens. The parser needs to | maintain some state, because some parts of the file consist of different | tokens. I thought the object could simply remember its st

Re: keeping state in an iterator object by rebinding next()

2008-03-19 Thread Peter Otten
Wilbert Berendsen wrote: > Hi, > > i am writing a simple parser, that generates tokens. The parser needs to > maintain some state, because some parts of the file consist of different > tokens. I thought the object could simply remember its state by assigning > it's next() method to the method tha

keeping state in an iterator object by rebinding next()

2008-03-19 Thread Wilbert Berendsen
Hi, i am writing a simple parser, that generates tokens. The parser needs to maintain some state, because some parts of the file consist of different tokens. I thought the object could simply remember its state by assigning it's next() method to the method that is currently parsing. When the st