Re: pushback iterator

2009-05-22 Thread Simon Forman
On May 17, 10:39 am, Matus wrote: > Hallo pylist, > > I searches web and python documentation for implementation of pushback > iterator but found none in stdlib. > > problem: > > when you parse a file, often you have to read a line from parsed file > before

Re: pushback iterator

2009-05-17 Thread Matus
#x27;s problem. He doesn't have a list (he /could/ build a list, and > thus defeat the purpose of having an iterator). He /could/ use alternative > data > structures, like the dictionary you are suggesting... and he is, he is using > his > pushback iterator, but he has to include

Re: pushback iterator

2009-05-17 Thread Luis Alberto Zarrabeitia Gomez
purpose of having an iterator). He /could/ use alternative data structures, like the dictionary you are suggesting... and he is, he is using his pushback iterator, but he has to include it over and over. Currently there is no good "pythonic" way of building a functions that decid

Re: pushback iterator

2009-05-17 Thread Mike Kazantsev
Somehow, I got the message off the list. On Sun, 17 May 2009 17:42:43 +0200 Matus wrote: > > Sounds to me more like an iterator with a cache - you can't really pull > > the line from a real iterable like generator function and then just push > > it back. > > true, that is why you have to implem

Re: pushback iterator

2009-05-17 Thread Mike Kazantsev
On Sun, 17 May 2009 16:39:38 +0200 Matus wrote: > I searches web and python documentation for implementation of pushback > iterator but found none in stdlib. > > problem: > > when you parse a file, often you have to read a line from parsed file > before you can de

pushback iterator

2009-05-17 Thread Matus
Hallo pylist, I searches web and python documentation for implementation of pushback iterator but found none in stdlib. problem: when you parse a file, often you have to read a line from parsed file before you can decide if you want that line it or not. if not, it would be a nice