Message245329
itertools.imap and map in Python 2.7 produces inconsistent behaviour when mapping the null (None) function over multiple sequences.
>>> [a for a in map(None, list("abcd"), range(3))]
[('a', 0), ('b', 1), ('c', 2), ('d', None)]
>>> from itertools import imap
>>> [a for a in imap(None, list("abcd"), range(3))]
[('a', 0), ('b', 1), ('c', 2)]
>>> [a for a in map(None, list("abcd"), range(3))] == [a for a in imap(None, list("abcd"), range(3))]
False
>>>
This inconsistent and unintuitive behvaiour caused a bug in my program |
|
Date |
User |
Action |
Args |
2015-06-13 22:05:17 | Ernesto Alfonso | set | recipients:
+ Ernesto Alfonso |
2015-06-13 22:05:16 | Ernesto Alfonso | set | messageid: <1434233116.75.0.429169275547.issue24446@psf.upfronthosting.co.za> |
2015-06-13 22:05:16 | Ernesto Alfonso | link | issue24446 messages |
2015-06-13 22:05:16 | Ernesto Alfonso | create | |
|