Skip to content

Commit

Permalink
define trait.__doc__ = trait.help (#816)
Browse files Browse the repository at this point in the history
improves inspection via tools like sphinx autodoc
  • Loading branch information
minrk committed Dec 16, 2022
1 parent 1dbf7e9 commit 74928f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions traitlets/traitlets.py
Expand Up @@ -558,6 +558,9 @@ def __init__(
if read_only is not None:
self.read_only = read_only
self.help = help if help is not None else ""
if self.help:
# define __doc__ so that inspectors like autodoc find traits
self.__doc__ = self.help

if len(kwargs) > 0:
stacklevel = 1
Expand Down

0 comments on commit 74928f6

Please sign in to comment.