summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-11-15 02:55:42 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-11-15 02:55:42 (GMT)
commit5681cbce812d3daf19eab3a58631076148aa22c8 (patch)
treef9e5c0fc42641c3d3c9c2d71a76f19e6192aa5b8 /Doc
parenteeeb9c4445391f0ec91d84d5f35634ffe42c66de (diff)
downloadcpython-5681cbce812d3daf19eab3a58631076148aa22c8.zip
cpython-5681cbce812d3daf19eab3a58631076148aa22c8.tar.gz
cpython-5681cbce812d3daf19eab3a58631076148aa22c8.tar.bz2
Small improvement to the implementation of __replace__().
Diffstat (limited to 'Doc')
-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 2d7f0a9..1e7b427 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -396,7 +396,7 @@ Example::
return dict(zip(('x', 'y'), self))
def __replace__(self, field, value):
'Return a new Point object replacing specified fields with new values'
- return Point(**dict(self.__asdict__().items() + kwds.items()))
+ return Point(**dict(zip(('x', 'y'), self) + kwds.items()))
x = property(itemgetter(0))
y = property(itemgetter(1))