New submission from Ernesto Alfonso:
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
----------
components: Interpreter Core, Library (Lib)
messages: 245329
nosy: Ernesto Alfonso
priority: normal
severity: normal
status: open
title: imap and map inconsistent behaviour
type: behavior
versions: Python 2.7
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue24446>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com