Zip with a list comprehension
Matt Gerrans
matt.gerrans at hp.com
Fri Dec 10 15:32:29 EST 2004
This is probably so easy that I'll be embarrassed by the answer. While
enhancing and refactoring some old code, I was just changing some map()s to
list comprehensions, but I couldn't see any easy way to change a zip() to a
list comprehension. Should I just let those sleeping dogs lie? (list
comprehensions seem more readable than map(), but if the list comprehension
that does the equivalent of zip() is less expressive than zip(), I'll stick
with zip()).
More information about the Python-list
mailing list