[Python-Dev] Re: PEP 322: Reverse Iteration

Raymond Hettinger python at rcn.com
Tue Nov 4 18:37:22 EST 2003


> >      iseq = irange(start, len(sq))
> >      if godown: iseq = reversed(iseq)
> 
> But this wouldn't work, would it?  irange() is an iterator, but
> reversed() only works for sequences (it refuses to secretly buffer the
> whole thing).

It works fine with xrange though.


Raymond Hettinger




More information about the Python-Dev mailing list