[Python-ideas] why has itertools.imap other semantics as the bultin map?

Mathias Panzenböck grosser.meister.morti at gmx.net
Wed Apr 28 17:59:21 CEST 2010


See:
 >>> map(None,['a','b'],[])
[('a', None), ('b', None)]
 >>> list(imap(None,['a','b'],[]))
[]

Why is that? I propose that imap should work like map (except from being a generator, of course).

System Info:
Python 2.6.2 (r262:71600, Jan 25 2010, 18:46:47)
[GCC 4.4.2 20091222 (Red Hat 4.4.2-20)] on linux2

	-panzi



More information about the Python-ideas mailing list