[Python-checkins] r65109 - in python/trunk: Demo/tkinter/guido/rmt.py Lib/string.py Lib/stringold.py Lib/test/test_grp.py Lib/test/test_pwd.py

georg.brandl python-checkins at python.org
Fri Jul 18 21:06:13 CEST 2008


Author: georg.brandl
Date: Fri Jul 18 21:06:13 2008
New Revision: 65109
Log:
Replace all map(None, a) with list(a).
Modified:
 python/trunk/Demo/tkinter/guido/rmt.py
 python/trunk/Lib/string.py
 python/trunk/Lib/stringold.py
 python/trunk/Lib/test/test_grp.py
 python/trunk/Lib/test/test_pwd.py
Modified: python/trunk/Demo/tkinter/guido/rmt.py
==============================================================================
--- python/trunk/Demo/tkinter/guido/rmt.py	(original)
+++ python/trunk/Demo/tkinter/guido/rmt.py	Fri Jul 18 21:06:13 2008
@@ -134,7 +134,7 @@
 file_m_apps.add('command')
 file_m_apps.delete(0, 'last')
 names = root.winfo_interps()
- names = map(None, names) # convert tuple to list
+ names = list(names)
 names.sort()
 for name in names:
 try:
Modified: python/trunk/Lib/string.py
==============================================================================
--- python/trunk/Lib/string.py	(original)
+++ python/trunk/Lib/string.py	Fri Jul 18 21:06:13 2008
@@ -68,7 +68,7 @@
 raise ValueError, "maketrans arguments must have same length"
 global _idmapL
 if not _idmapL:
- _idmapL = map(None, _idmap)
+ _idmapL = list(_idmap)
 L = _idmapL[:]
 fromstr = map(ord, fromstr)
 for i in range(len(fromstr)):
Modified: python/trunk/Lib/stringold.py
==============================================================================
--- python/trunk/Lib/stringold.py	(original)
+++ python/trunk/Lib/stringold.py	Fri Jul 18 21:06:13 2008
@@ -391,7 +391,7 @@
 raise ValueError, "maketrans arguments must have same length"
 global _idmapL
 if not _idmapL:
- _idmapL = map(None, _idmap)
+ _idmapL = list(_idmap)
 L = _idmapL[:]
 fromstr = map(ord, fromstr)
 for i in range(len(fromstr)):
Modified: python/trunk/Lib/test/test_grp.py
==============================================================================
--- python/trunk/Lib/test/test_grp.py	(original)
+++ python/trunk/Lib/test/test_grp.py	Fri Jul 18 21:06:13 2008
@@ -57,7 +57,7 @@
 namei = 0
 fakename = allnames[namei]
 while fakename in bynames:
- chars = map(None, fakename)
+ chars = list(fakename)
 for i in xrange(len(chars)):
 if chars[i] == 'z':
 chars[i] = 'A'
@@ -74,7 +74,7 @@
 except IndexError:
 # should never happen... if so, just forget it
 break
- fakename = ''.join(map(None, chars))
+ fakename = ''.join(chars)
 
 self.assertRaises(KeyError, grp.getgrnam, fakename)
 
Modified: python/trunk/Lib/test/test_pwd.py
==============================================================================
--- python/trunk/Lib/test/test_pwd.py	(original)
+++ python/trunk/Lib/test/test_pwd.py	Fri Jul 18 21:06:13 2008
@@ -62,7 +62,7 @@
 namei = 0
 fakename = allnames[namei]
 while fakename in bynames:
- chars = map(None, fakename)
+ chars = list(fakename)
 for i in xrange(len(chars)):
 if chars[i] == 'z':
 chars[i] = 'A'
@@ -79,7 +79,7 @@
 except IndexError:
 # should never happen... if so, just forget it
 break
- fakename = ''.join(map(None, chars))
+ fakename = ''.join(chars)
 
 self.assertRaises(KeyError, pwd.getpwnam, fakename)
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /