def get_enum_documentation ( class_name , module_name , enum_class_object ) : documentation = """.. _{module_name}.{class_name}:

``enum {class_name}``
+++++++{plus}++

**module:** ``{module_name}``""" . format ( module_name = module_name , class_name = class_name , plus = '+' * len ( class_name ) , ) if enum_class_object . __doc__ and enum_class_object . __doc__ . strip ( ) : documentation += '\n\n{}' . format ( _clean_literals ( inspect . cleandoc ( enum_class_object . __doc__ ) ) ) documentation += '\n\nConstant Values:\n' for e in enum_class_object : documentation += '\n- ``{}`` (``{}``)' . format ( e . name , repr ( e . value ) . lstrip ( 'u' ) ) return documentation
python docstring enum members
def get_enum_documentation(class_name, module_name, enum_class_object):
    documentation = """.. _{module_name}.{class_name}:

``enum {class_name}``
+++++++{plus}++

**module:** ``{module_name}``""".format(
        module_name=module_name,
        class_name=class_name,
        plus='+' * len(class_name),
    )

    if enum_class_object.__doc__ and enum_class_object.__doc__.strip():
        documentation += '\n\n{}'.format(_clean_literals(inspect.cleandoc(enum_class_object.__doc__)))

    documentation += '\n\nConstant Values:\n'
    for e in enum_class_object:
        documentation += '\n- ``{}`` (``{}``)'.format(e.name, repr(e.value).lstrip('u'))

    return documentation