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

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

[Python-Dev] Re: PEP 322: Reverse Iteration [Python-Dev] Re: PEP 322: Reverse IterationPhillip J. Eby pje at telecommunity.com
Wed Nov 5 09:54:43 EST 2003
At 07:29 AM 11/5/03 -0500, Raymond Hettinger wrote:
>Not really.  When you go to write the code, it becomes clear that it
>doesn't apply to enumerate or the other itertools.  The issue is that
>the iterator object holds only the result of iter(iterable) and is in no
>position to re-probe the underlying iterable to see if it supports
>reverse iteration.  The iterator object has no way of knowing in advance
>that it is going to be called by reversed().

Why not change enumerate() to return an iterable, rather than an 
iterator?  Then its __reversed__ method could attempt to delegate to the 
underlying iterable.  Is it likely that anyone relies on enumerate() being 
an iterator, rather than an iterable?


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