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

gh-118761: Use enum._simple_enum for annotationlib.Format #132031

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Apr 2, 2025

We can use the internal _simple_enum class decorator here, for slight faster enum creation. I don't think there's any good way to entirely avoid/defer the enum import, though.

A

@JelleZijlstra
Copy link
Member

I'm not a fan of using private functionality here; I'd rather this enum work the same way as an equivalent user-created way. If we think this is the right way to make an enum, we should make this decorator public.

@AA-Turner
Copy link
Member Author

My understanding is it's an intentionally internal-only decorator (eg used in ast and re). @ethanfurman is probably best placed to comment.

A

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 6, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants