A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-November/040041.html below:

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

[Python-Dev] Re: PEP 322: Reverse Iteration [Python-Dev] Re: PEP 322: Reverse IterationRaymond Hettinger python at rcn.com
Wed Nov 5 22:25:19 EST 2003
> > * There is a small group (including Jeremy Fincher) that consider a
> > reversal protocol to be essential.
> 
> And I think that as a protocol it needs a separate PEP, because new
> protocols are much more involved than new builtins.

Great idea.  The champions for __reverse__ can plead their case there.

> > * It is particularly useful for xrange() because it reduces the
overhead
> > to zero without touching the API.  The implementation patch on SF
shows
> > that this can be done cleanly.  Essentially, __reverse__ forwards
the
> > call to __iter__ with the arguments rearranged for reverse order.
> 
> The implementation could special-case xrange() and lists and "optimize
> the snot out of them" without the need for a general protocol.

Agreed!  I'll take __reversed__ out of the pep.

May I mark this one as accepted and move on?


Raymond Hettinger


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4