Issue 2726: Autodoc's autoclass directive should include constructor docstring (original) (raw)

The autoclass directive adds the class constructor's argspec to the header and shows the class docstring below it but doesn't add the constructor's docstring. I usually use the class docstring to describe the class and the constructor's docstring to describe the constructor arguments so if the constructor argspec is being shown, I would expect the description of it to be included below.

Result of svn diff sphinx/ext/autodoc.py:

Index: sphinx/ext/autodoc.py

--- sphinx/ext/autodoc.py (revision 62582) +++ sphinx/ext/autodoc.py (working copy) @@ -154,6 +154,13 @@ result.append(indent + '.. %s:: %s%s' % (what, qualname, args), '') result.append('', '')

I don't know how other people would expect autodoc to work so maybe this behavior could be controlled by a config param?