traitlets
traitlets copied to clipboard
help= does not set trait docstring
At the moment, it looks like the help=
text doesn't set the __doc__
attribute of traits, which produces this kind of output when using sphinx's autosummary:
Would it be possible to use the help text to also set __doc__
on traits or is there a good reason why this isn't done?
It isn't usual to set __doc__
on instances of types, is it?
@minrk - is there any reason not to though? Documentation pages like the one above would look a lot clearer.
What's generating that page? Is there any precedent for setting __doc__
on instances? I'm not necessarily opposed, I'd just like to not be the first to change the meaning of a a pretty fundamental Python attribute.
The page was generated by sphinx-automodapi but I think ultimately that uses autoattribute
from Sphinx's autodoc.
I second this request. I am running into exactly the same problem. I have put in help strings for each of my traits but they do not show up in the documentation. How do I document the traits that are used by a class? I would prefer to not replicate the help string, but documenting a class's traits even with duplicating the help string would be much better than getting a table like above.
I just came across the autoattribute attribute documentation. I discovered that I can add the documentation that I want by adding a triple-quoted docstring on the line below the Trait definition.
The triple quoted string works with the exception that when traits are inherited from parent classes, the subclass documentation shows the original trait documentation.