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


Groups > comp.lang.python > #104171 > unrolled thread

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

Started by"Sven R. Kunze" <srkunze@mail.de>
First post2016-03-06 20:55 +0100
Last post2016-03-06 20:55 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#104171 — Re: reversed(zip(...)) not working as intended

From"Sven R. Kunze" <srkunze@mail.de>
Date2016-03-06 20:55 +0100
SubjectRe: reversed(zip(...)) not working as intended
Message-ID<mailman.1.1457294135.2226.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web