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:
Docstrings produced by :func:`~collections.namedtuple` can now be updated::
Point = namedtuple('Point', ['x', 'y'])
- Point.__doc__ = 'ordered pair'
+ Point.__doc__ += ': Cartesian coodinate'
Point.x.__doc__ = 'abscissa'
Point.y.__doc__ = 'ordinate'