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/040005.html below:

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

[Python-Dev] Re: PEP 322: Reverse IterationSamuele Pedroni pedronis at bluewin.ch
Wed Nov 5 10:13:49 EST 2003
At 07:02 05.11.2003 -0800, Guido van Rossum wrote:
> > Among the comp.lang.python crowd, nearly everyone supported some form of
> > the PEP (with varying preferences on the name or where to put it).  The
> > community participation rate was high with about 120 posts across four
> > threads contributing to hammering out the current version of the pep.
>
>How many participants in those 120 posts?  (I recall a thread where
>one individual posted 100 messages. :-)
>
> > Is there anything else that needs to be done in the way of research,
> > voting, or cheerleading for pep to be accepted?
>
>Yes.  I'm getting cold feet about __reversed__.  Some folks seem to
>think that reversed() can be made to work on many iterators by having
>the iterator supply __reversed__; I think this is asking for trouble
>(e.g. you already pointed out why it couldn't be done for
>enumerate()).

yes, but __reversed__ is meanigful for iterables not iterators

I had the impression that reversed(.) is related to iter(.) for reverse 
iteration
and __reversed__ would correspond to __iter__ also for that, but this is 
meanigful for iterables that are not already iterators.

For iterators __iter__ is typically the identity, while __reversed__ is not 
really applicable which probably means that reverse iteration is more 
complicated that forward iteration <wink>.

regards.


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