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

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

[Python-Dev] Re: PEP 322: Reverse IterationAlex Martelli aleaxit at yahoo.com
Tue Nov 4 17:09:24 EST 2003
On Tuesday 04 November 2003 10:57 pm, Delaney, Timothy C (Timothy) wrote:
> > From: Alex Martelli [mailto:aleaxit at yahoo.com]
> >
> > or reversed(enumerate(seq)) if the index IS needed.
>
> Hmm - wouldn't this give an iterator that returned two values - an iterable
> for the seq, and an iterable for the indexes of seq?

I must be missing something.  enumerate(x) is an iterator with len(x)
values, each a pair; why would reversing it somehow "transpose" it...?


> I would think this would need to be:
>
>     reversed(*enumerate(seq))
>
> with the presumption being that reversed would reverse each parameter and
> return them in lockstep.

I'm not sure if reversed should take several parameters, but it if did this
would be like calling:
    reversed( (0, x[0]), (1,x[1]), (2,x[2]) )
If it "reversed each parameter and returned them in lockstep" then I'd
have x first and (0,1,2) second, no?


Alex


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