summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-03-13 01:26:19 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-03-13 01:26:19 (GMT)
commita6c6037f882573c9965e4fac74765357e42148e4 (patch)
treeb35d3490d3d547e3bd86f11e3ad761b2c6445f6b /Lib
parent17301e9fab311badbbe26a1efcb2decf637b324a (diff)
downloadcpython-a6c6037f882573c9965e4fac74765357e42148e4.zip
cpython-a6c6037f882573c9965e4fac74765357e42148e4.tar.gz
cpython-a6c6037f882573c9965e4fac74765357e42148e4.tar.bz2
Issues 2186 and 2187. Move map() from itertools to builtins.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/filecmp.py6
-rw-r--r--Lib/test/seq_tests.py4
-rw-r--r--Lib/test/test_heapq.py4
-rw-r--r--Lib/test/test_itertools.py1
-rw-r--r--Lib/test/test_set.py4
5 files changed, 10 insertions, 9 deletions
diff --git a/Lib/filecmp.py b/Lib/filecmp.py
index 14e1eb4..00fc135 100644
--- a/Lib/filecmp.py
+++ b/Lib/filecmp.py
@@ -12,7 +12,7 @@ Functions:
import os
import stat
import warnings
-from itertools import ifilterfalse, imap, izip
+from itertools import ifilterfalse, izip
__all__ = ["cmp","dircmp","cmpfiles"]
@@ -130,8 +130,8 @@ class dircmp:
self.right_list.sort()
def phase1(self): # Compute common names
- a = dict(izip(imap(os.path.normcase, self.left_list), self.left_list))
- b = dict(izip(imap(os.path.normcase, self.right_list), self.right_list))
+ a = dict(izip(map(os.path.normcase, self.left_list), self.left_list))
+ b = dict(izip(map(os.path.normcase, self.right_list), self.right_list))
self.common = list(map(a.__getitem__, filter(b.__contains__, a)))
self.left_only = list(map(a.__getitem__, ifilterfalse(b.__contains__, a)))
self.right_only = list(map(b.__getitem__, ifilterfalse(a.__contains__, b)))
diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py
index a3815e2..dfa18c5 100644
--- a/Lib/test/seq_tests.py
+++ b/Lib/test/seq_tests.py
@@ -79,10 +79,10 @@ class IterFuncStop:
def __next__(self):
raise StopIteration
-from itertools import chain, imap
+from itertools import chain, map
def itermulti(seqn):
'Test multiple tiers of iterators'
- return chain(imap(lambda x:x, iterfunc(IterGen(Sequence(seqn)))))
+ return chain(map(lambda x:x, iterfunc(IterGen(Sequence(seqn)))))
class CommonTest(unittest.TestCase):
# The type to be tested
diff --git a/Lib/test/test_heapq.py b/Lib/test/test_heapq.py
index 8ae1637..7969d6e 100644
--- a/Lib/test/test_heapq.py
+++ b/Lib/test/test_heapq.py
@@ -260,10 +260,10 @@ class S:
def __next__(self):
raise StopIteration
-from itertools import chain, imap
+from itertools import chain, map
def L(seqn):
'Test multiple tiers of iterators'
- return chain(imap(lambda x:x, R(Ig(G(seqn)))))
+ return chain(map(lambda x:x, R(Ig(G(seqn)))))
class TestErrorHandling(unittest.TestCase):
# only for C implementation
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 13dc1f9..7d905d8 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -9,6 +9,7 @@ from functools import reduce
maxsize = test_support.MAX_Py_ssize_t
minsize = -maxsize-1
ifilter = filter
+imap = map
def lzip(*args):
return list(zip(*args))
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 9e3d64f..ca3c02e 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -1560,10 +1560,10 @@ class S:
def __next__(self):
raise StopIteration
-from itertools import chain, imap
+from itertools import chain
def L(seqn):
'Test multiple tiers of iterators'
- return chain(imap(lambda x:x, R(Ig(G(seqn)))))
+ return chain(map(lambda x:x, R(Ig(G(seqn)))))
class TestVariousIteratorArgs(unittest.TestCase):