]> granicus.if.org Git - python/commitdiff
Small speedup
authorRaymond Hettinger <python@rcn.com>
Thu, 13 Dec 2007 23:52:59 +0000 (23:52 +0000)
committerRaymond Hettinger <python@rcn.com>
Thu, 13 Dec 2007 23:52:59 +0000 (23:52 +0000)
Lib/collections.py

index 0b0a26bb46129af9c1ae0c740db7921f734bd43c..abe8e0cc68b10e6549ff4e0e66f019d302d636f9 100644 (file)
@@ -2,6 +2,7 @@ __all__ = ['deque', 'defaultdict', 'namedtuple']
 
 from _collections import deque, defaultdict
 from operator import itemgetter as _itemgetter
+from itertools import izip as _izip
 from keyword import iskeyword as _iskeyword
 import sys as _sys
 
@@ -77,7 +78,7 @@ def namedtuple(typename, field_names, verbose=False):
         print template
 
     # Execute the template string in a temporary namespace
-    namespace = dict(itemgetter=_itemgetter)
+    namespace = dict(itemgetter=_itemgetter, zip=_izip)
     try:
         exec template in namespace
     except SyntaxError, e: