[Python-3000] Reverse file iteration patch updated

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Dec 10 07:12:54 CET 2007


Mark Russell wrote:
> I posted a patch (http://bugs.python.org/issue1677872) a while ago to  
> add support for reverse iteration through text files - i.e. making  
> this work:
> 
>       for line in reversed(open(path)):
>           print line

If this involves hacking reversed() to give it special
knowledge of files, I'm not sure it's the best place
to put it.

--
Greg


More information about the Python-3000 mailing list