Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > map(None,[1,2,3],[4,5]) gives [(1,4),(2,5),(3,None)] > > I didn't know that until checking the docs just now. Oh man, what a > hack! I always thought Python should have a built-in identity > function for situations like that. I guess it does the above instead. > Thanks. Jeez ;-) Of course, for OP's particular case, I think a specialized func() is even better, as the None are turned into "" in the process which is needed for string operation.
map(lambda *arg: tuple(map(lambda x: x is not None and x or "", arg)), ["a","b","c"],["d","e"]) -- http://mail.python.org/mailman/listinfo/python-list