File iteration in 2.2

Skip Montanaro skip at pobox.com
Wed Aug 28 19:10:17 CEST 2002


    Clarence> Your argument rests on the assertion "file iterators are
    Clarence> really intended work like the F.xreadlines() method". 

I will direct interested parties to a very long thread in Python-Dev during
July.  Start here:

    http://mail.python.org/pipermail/python-dev/2002-July/thread.html

and search for "Single- vs. Multi-pass iterability".  I think what it boils
down to is you shouldn't try too hard to pretend files are sequences.
Iteration is fine, but you can't "start over".

-- 
Skip Montanaro
skip at pobox.com
consulting: http://manatee.mojam.com/~skip/resume.html




More information about the Python-list mailing list