summaryrefslogtreecommitdiffstats
path: root/Lib/collections.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-14 01:24:44 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-14 01:24:44 (GMT)
commit380532117c2547bb0dedf6f85efa66d18a9abb88 (patch)
tree33e690cd422859aa0272fbe0a9d1f163e77fbaf2 /Lib/collections.py
parent8a78cadf561ea67649a84d9b4055dd4c24e2e0ba (diff)
downloadcpython-380532117c2547bb0dedf6f85efa66d18a9abb88.zip
cpython-380532117c2547bb0dedf6f85efa66d18a9abb88.tar.gz
cpython-380532117c2547bb0dedf6f85efa66d18a9abb88.tar.bz2
Merged revisions 59465-59487 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r59467 | georg.brandl | 2007-12-11 17:32:49 +0100 (Tue, 11 Dec 2007) | 2 lines Add another GHOP contributor. ........ r59468 | kurt.kaiser | 2007-12-11 20:35:12 +0100 (Tue, 11 Dec 2007) | 3 lines IDLE_tabbedpages.071101.patch Tal Einat Cosmetic changes, one bug. Remove tabpage.py, replaced by tabbedpages.py ........ r59471 | gerhard.haering | 2007-12-11 22:07:40 +0100 (Tue, 11 Dec 2007) | 9 lines Forward-port of commit 59184. - Backported a workaround for a bug in SQLite 3.2.x/3.3.x versions where a statement recompilation with no bound parameters lead to a segfault - Backported a fix necessary because of an SQLite API change in version 3.5. This prevents segfaults when executing empty queries, like our test suite does ........ r59475 | christian.heimes | 2007-12-12 19:09:06 +0100 (Wed, 12 Dec 2007) | 1 line Fixed a nasty problem in the xxmodule.c ........ r59478 | raymond.hettinger | 2007-12-13 01:08:37 +0100 (Thu, 13 Dec 2007) | 1 line Fix bug 1604. deque.__init__() did not clear existing contents like list.__init__. Not a backport candidate. ........ r59480 | alexandre.vassalotti | 2007-12-13 18:58:23 +0100 (Thu, 13 Dec 2007) | 2 lines Fix issue #1313119: urlparse "caches" parses regardless of encoding ........ r59482 | christian.heimes | 2007-12-13 20:23:16 +0100 (Thu, 13 Dec 2007) | 1 line Fixed bug #1613: Makefile's VPATH feature is broken ........ r59484 | guido.van.rossum | 2007-12-13 21:50:10 +0100 (Thu, 13 Dec 2007) | 3 lines Patch #1608. Someone with access to autoconf 2.61 or higher needs to run it and check in the resulting configure file. ........ r59485 | thomas.heller | 2007-12-13 22:20:29 +0100 (Thu, 13 Dec 2007) | 1 line Ran autoconf. ........ r59486 | raymond.hettinger | 2007-12-13 23:55:52 +0100 (Thu, 13 Dec 2007) | 1 line Simplify implementation of __replace__() ........ r59487 | raymond.hettinger | 2007-12-14 00:52:59 +0100 (Fri, 14 Dec 2007) | 1 line Small speedup ........
Diffstat (limited to 'Lib/collections.py')
-rw-r--r--Lib/collections.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/collections.py b/Lib/collections.py
index f5c524b..5fb0e05 100644
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -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
@@ -70,14 +71,14 @@ def namedtuple(typename, field_names, verbose=False):
return dict(zip(%(field_names)r, self))
def __replace__(self, **kwds):
'Return a new %(typename)s object replacing specified fields with new values'
- return %(typename)s(**dict(list(zip(%(field_names)r, self)) + list(kwds.items()))) \n''' % locals()
+ return %(typename)s(**dict(zip(%(field_names)r, self), **kwds)) \n''' % locals()
for i, name in enumerate(field_names):
template += ' %s = property(itemgetter(%d))\n' % (name, i)
if verbose:
print(template)
# Execute the template string in a temporary namespace
- namespace = dict(itemgetter=_itemgetter)
+ namespace = dict(itemgetter=_itemgetter, zip=_izip)
try:
exec(template, namespace)
except SyntaxError as e: