cpython: Lib/collections.py diff (original) (raw)
Mercurial > cpython
diff Lib/collections.py @ 70608:26d5f022eb1a 2.7
Fix named tuples to work with vars().
author | Raymond Hettinger python@rcn.com |
---|---|
date | Thu, 02 Jun 2011 20:40:35 -0700 |
parents | c64c41974d1f |
children | aca1a271c4fc |
line wrap: on
line diff
--- a/Lib/collections.py +++ b/Lib/collections.py @@ -312,6 +312,7 @@ def namedtuple(typename, field_names, ve def _asdict(self): 'Return a new OrderedDict which maps field names to their values' return OrderedDict(zip(self._fields, self)) \n
__dict__ = property(_asdict) \n[](#l1.7) def _replace(_self, **kwds):[](#l1.8) 'Return a new %(typename)s object replacing specified fields with new values'[](#l1.9) result = _self._make(map(kwds.pop, %(field_names)r, _self))[](#l1.10)