summaryrefslogtreecommitdiffstats
path: root/Doc/library/collections.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-01-07 20:56:05 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-01-07 20:56:05 (GMT)
commitf5e8af1bb7e375e86298ae7a4ee5b6c3e8a22db4 (patch)
tree8cbfe6aeb3e8a39c55ab396035cec41bb0d13720 /Doc/library/collections.rst
parentfb3ced663dc321310cb319a1b9fcf3d7b7b1deae (diff)
downloadcpython-f5e8af1bb7e375e86298ae7a4ee5b6c3e8a22db4.zip
cpython-f5e8af1bb7e375e86298ae7a4ee5b6c3e8a22db4.tar.gz
cpython-f5e8af1bb7e375e86298ae7a4ee5b6c3e8a22db4.tar.bz2
Use get() instead of pop() for the optimized version of _replace().
Diffstat (limited to 'Doc/library/collections.rst')
-rw-r--r--Doc/library/collections.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index e797296..fb9b958 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -531,7 +531,7 @@ faster versions that bypass error-checking and localize variable access::
>>> class Point(namedtuple('Point', 'x y')):
_make = classmethod(tuple.__new__)
def _replace(self, _map=map, **kwds):
- return self._make(_map(kwds.pop, ('x', 'y'), self))
+ return self._make(_map(kwds.get, ('x', 'y'), self))
Default values can be implemented by using :meth:`_replace` to
customize a prototype instance::