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

[Enum] make some private attributes public #112328

Open
ethanfurman opened this issue Nov 23, 2023 · 3 comments
Open

[Enum] make some private attributes public #112328

ethanfurman opened this issue Nov 23, 2023 · 3 comments
Assignees
Labels
3.13 bugs and security fixes deferred-blocker docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@ethanfurman
Copy link
Member

ethanfurman commented Nov 23, 2023

Feature or enhancement

Make _EnumDict, _EnumDict._member_names, and possibly other private names public.

This is to make subclassing EnumType and other advanced behavior supported, such as having multiple values per member.

Linked PRs

@ethanfurman ethanfurman added type-feature A feature request or enhancement stdlib Python modules in the Lib dir 3.13 bugs and security fixes labels Nov 23, 2023
@ethanfurman ethanfurman self-assigned this Nov 23, 2023
@ethanfurman ethanfurman added the docs Documentation in the Doc dir label Nov 23, 2023
ethanfurman added a commit that referenced this issue Dec 5, 2023
* [Enum] Make some private attributes public.

- ``_EnumDict`` --> ``EnumDict``
- ``EnumDict._member_names`` --> ``EnumDict.member_names``
- ``Enum._add_alias_``
- ``Enum._add_value_alias_``

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@hugovk
Copy link
Member

hugovk commented Dec 11, 2023

The PR has been merged, shall we close this, or is there more to do?

@ethanfurman
Copy link
Member Author

Closing, thanks for the reminder.

aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
…H-112514)

* [Enum] Make some private attributes public.

- ``_EnumDict`` --> ``EnumDict``
- ``EnumDict._member_names`` --> ``EnumDict.member_names``
- ``Enum._add_alias_``
- ``Enum._add_value_alias_``

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@JelleZijlstra
Copy link
Member

EnumDict is now public and included in Enum.__all__, but it is not documented at https://docs.python.org/3.13/library/enum.html or mentioned in the What's New for 3.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes deferred-blocker docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-feature A feature request or enhancement
3 participants