gh-112328: [Enum] Make some private attributes public.#112514
gh-112328: [Enum] Make some private attributes public.#112514ethanfurman merged 6 commits intopython:mainfrom
Conversation
- ``_EnumDict`` --> ``EnumDict`` - ``EnumDict._member_names`` --> ``EnumDict.member_names`` - ``EnumType._add_alias_`` - ``EnumType._add_value_alias_``
sobolevn
left a comment
There was a problem hiding this comment.
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.
I think we can drop Python2 part.
There was a problem hiding this comment.
Keeping for now -- I'll probably change _order_ to be definitive so Enum still works on python implementations without ordered dictionaries.
AlexWaygood
left a comment
There was a problem hiding this comment.
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 <Alex.Waygood@Gmail.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
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 <Alex.Waygood@Gmail.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
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 <Alex.Waygood@Gmail.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@ethanfurman Triage: Is this still the case? If so, please could you create the 3.12 backport? Otherwise let's remove the backport label. |
|
3.12 is now security-only, so the backport is no longer needed. https://discuss.python.org/t/python-3-12-is-now-security-fix-only/87520 |
_EnumDict-->EnumDictEnumDict._member_names-->EnumDict.member_namesEnum._add_alias_Enum._add_value_alias_📚 Documentation preview 📚: https://cpython-previews--112514.org.readthedocs.build/