[Python-bugs-list] [ python-Bugs-798473 ] inconsistent behavior of map and imap

SourceForge.net noreply at sourceforge.net
Mon Sep 1 04:41:17 EDT 2003


Bugs item #798473, was opened at 2003-09-01 19:41
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798473&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: George Yoshida (quiver)
Assigned to: Nobody/Anonymous (nobody)
Summary: inconsistent behavior of map and imap

Initial Comment:
If you pass sequences to map and imap and
the sizes of sequences are not equal,
map and imap don't behave the same way.

The code below is a simple example.
The size of seq1 and seq2 is not equal.

>>> seq1 = [0, 1, 2]
>>> seq2 = ['a', 'b']
>>> import itertools
>>> for x,y in map(None, seq1, seq2):print x,y
...
0 a
1 b
2 None
>>> for x,y in itertools.imap(None, seq1, 
seq2):print x,y
...
0 a
1 b

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=798473&group_id=5470



More information about the Python-bugs-list mailing list