8000 bug: Problem when rendering ENUM value · Issue #124 · mkdocstrings/python · GitHub
[go: up one dir, main page]

Skip to content
bug: Problem when rendering ENUM value #124
Closed
@gadsc

Description

@gadsc

Description of the bug

The ENUM render isn't rendering the ENUM name in the value.

To Reproduce

  1. Create an enum:
class MyEnum(Enum):
    """Just a ENUM example"""
    MY_VALUE_1 = 1
    MY_VALUE_2 = 2
  1. Reference the ENUM value in a field:
MY_FIELD = MyEnum.MY_VALUE_1.value

MY_FIELD_ARRAY = [ MyEnum.MY_VALUE_1.value, MyEnum.MY_VALUE_2.value ]
  1. Generate the doc.

Generated doc:
image

Expected behavior

For ENUM values the ENUM name/full qualified name helps to gather context, it should render at least the ENUM name in the value, like MyEnum.MY_VALUE_1.value, the constant MY_VALUE_1.value or the full qualified name my_module.MyEnum.MY_VALUE_1.value.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0