Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #104171

Re: reversed(zip(...)) not working as intended

From "Sven R. Kunze" <srkunze@mail.de>
Newsgroups comp.lang.python
Subject Re: reversed(zip(...)) not working as intended
Date 2016-03-06 20:55 +0100
Message-ID <mailman.1.1457294135.2226.python-list@python.org> (permalink)
References <56DC7727.1090001@mail.de> <20160306123850.6f78ab7c@bigbox.christie.dr> <20160306125153.05527138@bigbox.christie.dr>

Show all headers | View raw


On 06.03.2016 19:51, Tim Chase wrote:
> So it looks like one needs to either
>
>     results = reversed(list(zip(...)))
>
> or, more efficiently (doing it with one less duplication of the list)
>
>     results = list(zip(...))
>     results.reverse()

Nice idea. :) Unfortunately, I used it while drafting some unittests and 
I love SHORT oneliners:

for c in reversed(zip(ascii_lowercase, ascii_uppercase)):
     ...

ooops. :-/

Best,
Sven

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: reversed(zip(...)) not working as intended "Sven R. Kunze" <srkunze@mail.de> - 2016-03-06 20:55 +0100

csiph-web