-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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-112328: [Enum] Make some private attributes public. #112514
Conversation
- ``_EnumDict`` --> ``EnumDict`` - ``EnumDict._member_names`` --> ``EnumDict.member_names`` - ``EnumType._add_alias_`` - ``EnumType._add_value_alias_``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work! The main question I have, since I am not as deep in the context of enum
as you are, what is the main motivation for this? The issue does not have any details :(
Doc/howto/enum.rst
Outdated
- :attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a | ||
:class:`str`, that will not be transformed into members, and will be removed | ||
from the final class | ||
- :attr:`~Enum._order_` -- used in Python 2/3 code to ensure member order is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop Python2 part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping for now -- I'll probably change _order_
to be definitive so Enum still works on python implementations without ordered dictionaries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the syntax in enum.rst
is incorrect currently:
When you're done making the requested changes, leave the comment: |
Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Nikita Sobolev <[email protected]>
I have made the requested changes; please review again. I also moved the two |
…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 <[email protected]> Co-authored-by: Nikita Sobolev <[email protected]>
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @ethanfurman, I could not cleanly backport this to
|
Backporting because changes are needed for a bug-fix. |
…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 <[email protected]> Co-authored-by: Nikita Sobolev <[email protected]>
_EnumDict
-->EnumDict
EnumDict._member_names
-->EnumDict.member_names
Enum._add_alias_
Enum._add_value_alias_
📚 Documentation preview 📚: https://cpython-previews--112514.org.readthedocs.build/