3 ms·
I also believe that the 'zip' name hurts intuition by favoring `zip(long_list1, long_list2)`, when `zip(*pairs)` is just as useful. From a mathematical viewpoi
by BoppreH 3y ago
I also believe that the 'zip' name hurts intuition by favoring `zip(long_list1, long_list2)`, when `zip(*pairs)` is just as useful.
From a mathematical viewpoint, 'zip' is just transpose, and therefore its own inverse. But because of the zipping metaphor, this feels perfectly normal:
pairs = zip(sources, destinations)
While this feels like black magic:
sources, destinations = zip(*pairs)