diff options
author | Raymond Hettinger <python@rcn.com> | 2008-01-10 20:37:12 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-01-10 20:37:12 (GMT) |
commit | e850c466c7dd25baac71997d6ca073e3586526b5 (patch) | |
tree | 523f765bb66dd223d20e10cef3708b5a5fafe279 /Lib/collections.py | |
parent | e1655088ca65644312f02a147a0f9ad968cde2d9 (diff) | |
download | cpython-e850c466c7dd25baac71997d6ca073e3586526b5.zip cpython-e850c466c7dd25baac71997d6ca073e3586526b5.tar.gz cpython-e850c466c7dd25baac71997d6ca073e3586526b5.tar.bz2 |
Clarify how to add a field to a named tuple.
Diffstat (limited to 'Lib/collections.py')
-rw-r--r-- | Lib/collections.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/collections.py b/Lib/collections.py index 47b0397..267c39f 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -137,6 +137,9 @@ if __name__ == '__main__': print Point(11, 22)._replace(x=100) + Point3D = namedtuple('Point3D', Point._fields + ('z',)) + print Point3D.__doc__ + import doctest TestResults = namedtuple('TestResults', 'failed attempted') print TestResults(*doctest.testmod()) |