Moshe Zadka wrote: > (assume a = [1, 2, 3]) > > On Mon, 17 Jul 2000, Gordon McMillan wrote: > > > How about a fourth: zip(a) is the same as zip(a, []) ? > > Huh??????????????????? > > > Look at it this way: what should zip(a, pad=None) return? > > [(1,), (2,), (3,)], of course Then why does the PEP say: >>> zip(a, b, c, d, pad=None) [(1, 5, 9, 12), (2, 6, 10, 13), (3, 7, 11, None), (4, 8, None, None)] >>> map(None, a, b, c, d) [(1, 5, 9, 12), (2, 6, 10, 13), (3, 7, 11, None), (4, 8, None, None)] If you want no padding, you don't specify a pad arg. pad=None means "pad with None". > > Obviously: [(1, None), (2, None), (3, None)] > > Why? To be consistent. - Gordon
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4