diff options
author | Raymond Hettinger <python@rcn.com> | 2015-11-09 16:24:53 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2015-11-09 16:24:53 (GMT) |
commit | 850be0fb184ee1a5a42df5ecc1b8b62c433b1c6e (patch) | |
tree | be6d145896ea49b4dc6fbb64ef89f9c351d45dea /Doc/library/collections.rst | |
parent | 5e2e70029bdc9c52f9bb49f4cf207eb95c2da410 (diff) | |
download | cpython-850be0fb184ee1a5a42df5ecc1b8b62c433b1c6e.zip cpython-850be0fb184ee1a5a42df5ecc1b8b62c433b1c6e.tar.gz cpython-850be0fb184ee1a5a42df5ecc1b8b62c433b1c6e.tar.bz2 |
Improve namedtuple doc string examples
Diffstat (limited to 'Doc/library/collections.rst')
-rw-r--r-- | Doc/library/collections.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 0e5ff20..8ab7571 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -929,10 +929,10 @@ Docstrings can be customized by making direct assignments to the ``__doc__`` fields: >>> Book = namedtuple('Book', ['id', 'title', 'authors']) - >>> Book.__doc__ = 'Hardcover book in active collection' + >>> Book.__doc__ += ': Hardcover book in active collection' >>> Book.id.__doc__ = '13-digit ISBN' >>> Book.title.__doc__ = 'Title of first printing' - >>> Book.author.__doc__ = 'List of authors sorted by last name' + >>> Book.authors.__doc__ = 'List of authors sorted by last name' Default values can be implemented by using :meth:`_replace` to customize a prototype instance: |