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

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

[Python-Dev] Re: PEP 322: Reverse IterationAndrew P. Lentvorski, Jr. bsder at allcaps.org
Wed Nov 5 19:26:12 EST 2003
On Wed, 5 Nov 2003, Guido van Rossum wrote:

> I'm okay with adding reversed() as a builtin that works for sequences
> only but I'm not okay with adding the __reversed__ protocol.

But, doesn't this effectively take the PEP back to the original proposal
of a sequence method that it drifted away from?

With the restriction to sequences, reversed() is then likely to be
implemented as a thin wrapper around seq.somerevmethod() which could then
return either a new reversed sequence, an iterable, or an iterator
depending upon efficiency, implementation, thread-safety, etc.

Since reversed() is turning out not be generally applicable anyway,
perhaps going back to the original idea of a sequence method would be a
good thing?

-a

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