domdfcoding / enum_tools

Tools to expand Python's enum module.
https://enum-tools.readthedocs.io/en/latest
GNU Lesser General Public License v3.0
8 stars 7 forks source link

Support per-enum-value comments #62

Open brandon-leapyear opened 2 years ago

brandon-leapyear commented 2 years ago

Description

sphinx-autodoc supports the use of #: comments to document class attributes (ref). It would be great to have the same support in enum_tools

e.g.

class MyEnum(Enum):
    #: This is an A value
    A = auto()

    #: This is another value
    B = auto()

Version

Other Additional Information:

1kastner commented 2 years ago

It is already implemented as long as you use the decorator document_enum, see https://enum-tools.readthedocs.io/en/latest/api/documentation.html#enum_tools.documentation.document_enum.

This, however, adds this library as a runtime dependency to your project. That is not beautiful but currently up to my knowledge not avoidable.