summaryrefslogtreecommitdiffstats
path: root/Lib/collections.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2011-06-03 06:40:24 (GMT)
committerRaymond Hettinger <python@rcn.com>2011-06-03 06:40:24 (GMT)
commit3d89057ff80261e8960420305b432cd9783bb4e2 (patch)
tree84778cfe5a4fd0db53d202bae6b9c5b1cdcd648b /Lib/collections.py
parent9028928156b187eb0d684233960c568b46f11088 (diff)
downloadcpython-3d89057ff80261e8960420305b432cd9783bb4e2.zip
cpython-3d89057ff80261e8960420305b432cd9783bb4e2.tar.gz
cpython-3d89057ff80261e8960420305b432cd9783bb4e2.tar.bz2
Fix named tuples to work with vars().
Diffstat (limited to 'Lib/collections.py')
-rw-r--r--Lib/collections.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/collections.py b/Lib/collections.py
index b904980..2b6abd8 100644
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -268,6 +268,8 @@ class {typename}(tuple):
'Return a new OrderedDict which maps field names to their values'
return OrderedDict(zip(self._fields, self))
+ __dict__ = property(_asdict)
+
def _replace(_self, **kwds):
'Return a new {typename} object replacing specified fields with new values'
result = _self._make(map(kwds.pop, {field_names!r}, _self))