Skip to content

Show enum members in Annotated types like Literal does - #14654

Open
gyanu2507 wants to merge 1 commit into
sphinx-doc:masterfrom
gyanu2507:annotated-enum-display
Open

Show enum members in Annotated types like Literal does#14654
gyanu2507 wants to merge 1 commit into
sphinx-doc:masterfrom
gyanu2507:annotated-enum-display

Conversation

@gyanu2507

Copy link
Copy Markdown

Annotated[int, Color.red] was going through repr(), so autodoc printed <Color.red: 'red'>. Literal already formats enum members as :py:attr: links — reused that for Annotated metadata.

Fixes #14653

repr() was dumping things like <Color.red: 'red'> into the docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad display of annotated enum members

1 participant