High memory usage - program mistake or Python feature?

Gerald Klix Gerald.Klix at klix.ch
Sun May 25 09:14:25 EDT 2003


Simply call xreadlines again, that gives a new iterator.

Ben S wrote:
> Hmm, in quick experiments with using xreadlines instead of readlines,
> there is obviously the problem that while a single iteration over either
> container works the same way, in order to repeat iterations over
> xreadlines I need to somehow reset the iterator, which a quick look at
> the documentation doesn't show me how to do. How do I do this, so that
> my functions can take a list of lines without caring whether those lines
> are in memory or coming from xreadlines?
> 
> --
> Ben Sizer
> http://pages.eidosnet.co.uk/kylotan
> 
> 





More information about the Python-list mailing list