[Python-3000] Reverse file iteration patch updated

Gregory P. Smith greg at krypto.org
Mon Dec 10 07:21:13 CET 2007


it doesn't.  read the patch.  it adds a __reversed__ method.

 http://bugs.python.org/file8902/reverse-file-iterator-20071209.diff

On 12/9/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>
> 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
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe:
> http://mail.python.org/mailman/options/python-3000/greg%40krypto.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20071209/4d8a8275/attachment-0001.htm 


More information about the Python-3000 mailing list