unzip function?

Neal Becker ndbecker2 at gmail.com
Wed Jan 18 09:33:34 EST 2012

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.

More information about the Python-list mailing list