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


Groups > comp.lang.python > #19082

unzip function?

From Neal Becker <ndbecker2@gmail.com>
Subject unzip function?
Date 2012-01-18 09:33 -0500
Newsgroups comp.lang.python
Message-ID <mailman.4828.1326897240.27778.python-list@python.org> (permalink)

Show all headers | View raw


python has builtin zip, but not unzip

A bit of googling found my answer for my decorate/sort/undecorate problem:

a, b = zip (*sorted ((c,d) for c,d in zip (x,y)))

That zip (*sorted...

does the unzipping.

But it's less than intuitively obvious.

I'm thinking unzip should be a builtin function, to match zip.

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


Thread

unzip function? Neal Becker <ndbecker2@gmail.com> - 2012-01-18 09:33 -0500
  Re: unzip function? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-18 15:27 +0000
    Re: unzip function? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-18 11:20 -0500
      Re: unzip function? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-18 23:20 +0000
        Re: unzip function? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-19 10:56 -0500
        RE: unzip function? "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-02-03 00:53 +0000
  Re: unzip function? Hrvoje Niksic <hniksic@xemacs.org> - 2012-01-18 19:01 +0100

csiph-web