diff options
author | Raymond Hettinger <python@rcn.com> | 2007-12-14 19:19:59 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2007-12-14 19:19:59 (GMT) |
commit | 07ae83f8400702a78825204751604b98b6f69c65 (patch) | |
tree | 857a958d537304f4a4709e70b5a31c2352ed1619 /Doc | |
parent | adbda844d0782a64a278561f08bdf7b0d8218bdb (diff) | |
download | cpython-07ae83f8400702a78825204751604b98b6f69c65.zip cpython-07ae83f8400702a78825204751604b98b6f69c65.tar.gz cpython-07ae83f8400702a78825204751604b98b6f69c65.tar.bz2 |
Faster and simpler _replace() method
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/collections.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index d5f4283..d782c69 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -402,7 +402,7 @@ Example:: def _replace(self, **kwds): 'Return a new Point object replacing specified fields with new values' - return Point(**dict(zip(('x', 'y'), self), **kwds)) + return Point(*map(kwds.get, ('x', 'y'), self)) x = property(itemgetter(0)) y = property(itemgetter(1)) |