>>> list(map(None, a, b, c)) Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> list(map(None, a, b, c)) TypeError: 'NoneType' object is not callable
>>> map(None, a, b, c)
[('a1', 'b1', 'c1'), (None, 'b2', 'c2'), (None, 'b3', None)]
Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).
@PascalvKooten it is not required. itertools is a builtin C module anyway.
Do we not have a non itertools Python 3 solution?
You can either use itertools.izip_longest (Python 2.6+), or you can use map with None. It is a little known feature of map (but map changed in Python 3.x, so this only works in Python 2.x).