Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow control over Enum repr #11803

Closed
rhshadrach opened this issue Dec 19, 2023 · 1 comment · Fixed by #11879
Closed

Allow control over Enum repr #11803

rhshadrach opened this issue Dec 19, 2023 · 1 comment · Fixed by #11879

Comments

@rhshadrach
Copy link

rhshadrach commented Dec 19, 2023

Is your feature request related to a problem? Please describe.

From #9272, this commit removed any user control over the representation of the Enum in the docs. As a result, what we would like to be represented as <no_default> becomes the slightly ugly _NoDefault.no_default in the pandas docs.

Describe the solution you'd like
Add a check to see if the user is overwriting Enum's repr: object.__repr__ is Enum.__repr__. If they are overwriting it, just use the repr as-is.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

  • [e.g. URL or Ticket]
@picnixz
Copy link
Member

picnixz commented Dec 24, 2023

PR is welcomed. I agree that using a custom __repr__ (if available) is better.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants