summaryrefslogtreecommitdiffstats
path: root/Lib/collections
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-08-30 16:13:48 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-08-30 16:13:48 (GMT)
commit7a3602e7cf1c0f54d52c563afca50c2e09e7bbf9 (patch)
treeba15e1f7acbbe28daf54c205f234885423e1b17a /Lib/collections
parent1a83746418862b7618d888d2e338ad9dd9776313 (diff)
downloadcpython-7a3602e7cf1c0f54d52c563afca50c2e09e7bbf9.zip
cpython-7a3602e7cf1c0f54d52c563afca50c2e09e7bbf9.tar.gz
cpython-7a3602e7cf1c0f54d52c563afca50c2e09e7bbf9.tar.bz2
Issue #24931: Resolve __dict__ conflict in namedtuple subclasses.
Diffstat (limited to 'Lib/collections')
-rw-r--r--Lib/collections/__init__.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index 565ae86..09afc8a 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -272,23 +272,14 @@ class {typename}(tuple):
'Return a nicely formatted representation string'
return self.__class__.__name__ + '({repr_fmt})' % self
- @property
- def __dict__(self):
- 'A new OrderedDict mapping field names to their values'
- return OrderedDict(zip(self._fields, self))
-
def _asdict(self):
'Return a new OrderedDict which maps field names to their values.'
- return self.__dict__
+ return OrderedDict(zip(self._fields, self))
def __getnewargs__(self):
'Return self as a plain tuple. Used by copy and pickle.'
return tuple(self)
- def __getstate__(self):
- 'Exclude the OrderedDict from pickling'
- return None
-
{field_defs}
"""