How can I provide Sphinx documentation for a namedtuple (with autodoc)?
You don't actually need to extend the namedtuple at all. You can put the docstring after the namedtuple. This actually works for constants and attributes as well.
ERBFilterCoeffs = namedtuple('ERBFilterCoeffs', ['A0', 'gain', ])
""" Magic coefficients.
.. py:attribute:: A0
The A0 attribute is something
.. py:attribute:: gain
The gain attribute is blah blah
"""
How about after defining ERBFilterCoeffs
with the namedtuple, try assigning that doc string to ERBFilterCoeffs.__doc__
?
EDIT: Ok, how about this then:
class ERBFilterCoeffs(namedtuple('ERBFilterCoeffs','a b c')):
"""
this is the doc string for ERBFilterCoeffs
"""