summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-11-15 03:16:09 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-11-15 03:16:09 (GMT)
commit7c3738e11c35a7ac1c4ea8bdff9ec4d906db537e (patch)
tree6cd2aec952992d13dd7f6093cfab6bc0d6672a76
parent213ae014dbeecf44a7adf2e14f38e0a52258f204 (diff)
downloadcpython-7c3738e11c35a7ac1c4ea8bdff9ec4d906db537e.zip
cpython-7c3738e11c35a7ac1c4ea8bdff9ec4d906db537e.tar.gz
cpython-7c3738e11c35a7ac1c4ea8bdff9ec4d906db537e.tar.bz2
Example of multiple replacements.
-rw-r--r--Doc/library/collections.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 0c88861..89885ab 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -463,8 +463,8 @@ two additonal methods and a read-only attribute.
>>> p.__replace__(x=33)
Point(x=33, y=22)
- >>> for recordnum, record in inventory:
- ... inventory[recordnum] = record.replace(total = record.price * record.quantity)
+ >>> for partnum, record in inventory.items():
+ ... inventory[partnum] = record.__replace__(price=newprices[partnum], updated=time.now())
.. attribute:: somenamedtuple.__fields__