Adding docstrings to namedtuples?
In Python 3, no wrapper is needed, as the __doc__ attributes of types is writable. from collections import namedtuple Point = namedtuple(‘Point’, ‘x y’) Point.__doc__ = ”’\ A 2-dimensional coordinate x – the abscissa y – the ordinate”’ This closely corresponds to a standard class definition, where the docstring follows the header. class Point(): ”’A … Read more