commit | e850c466c7dd25baac71997d6ca073e3586526b5 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Thu Jan 10 20:37:12 2008 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Thu Jan 10 20:37:12 2008 +0000 |
tree | 523f765bb66dd223d20e10cef3708b5a5fafe279 | |
parent | e1655088ca65644312f02a147a0f9ad968cde2d9 [diff] [blame] |
Clarify how to add a field to a named tuple.
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 @@ 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())