-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-136672: Docs: Move Enum functions and add examples #136791
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-136672: Docs: Move Enum functions and add examples #136791
Conversation
Thanks for reviewing, @AA-Turner 🙃 |
When the `Enum` functions `_add_alias_` and `_add_value_alias_` were added in de6bca9, the documentation for them was done under `EnumType` instead of `Enum`. This change moves them to the docs of the `Enum` class and adds an example for each function.
This change moves the `versionadded` for `EnumType` to the top. Additionally, it fixes the indentation of another `versionchanged` entry.
69e75be
to
4b25a5f
Compare
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.
Mostly good, just one small change.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
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.
Thank you @RafaelWO! Please could you have a look at Ethan's suggestions.
A
Upon fixing the ordering of the methods under "Supported _sunder_ names", I noticed that this section and the above ("Supported __dunder__ names") are duplicated in the enum API docs and enum HOWTO - but they are not in sync. Is there a way to connect those sections (i.e. include the content to have only one source of truth)? Or should I just remove one, e.g., in the HOWTO, and link to the other one? Thanks for your suggestions! |
I have made the requested changes; please review again (Just trying to ensure that someone is aware of my comment above.) |
Thanks for making the requested changes! @AA-Turner, @ethanfurman: please review the changes made to this pull request. |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Thanks @RafaelWO for the PR, and @ethanfurman for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…-136791) * Docs: Move Enum functions and add examples When the `Enum` functions `_add_alias_` and `_add_value_alias_` were added in de6bca9, the documentation for them was done under `EnumType` instead of `Enum`. This change moves them to the docs of the `Enum` class and adds an example for each function. --------- (cherry picked from commit 003bd8c) Co-authored-by: RafaelWO <[email protected]> Co-authored-by: Ethan Furman <[email protected]>
…-136791) * Docs: Move Enum functions and add examples When the `Enum` functions `_add_alias_` and `_add_value_alias_` were added in de6bca9, the documentation for them was done under `EnumType` instead of `Enum`. This change moves them to the docs of the `Enum` class and adds an example for each function. --------- (cherry picked from commit 003bd8c) Co-authored-by: RafaelWO <[email protected]> Co-authored-by: Ethan Furman <[email protected]>
GH-137688 is a backport of this pull request to the 3.14 branch. |
GH-137689 is a backport of this pull request to the 3.13 branch. |
…) (#137689) Co-authored-by: RafaelWO <[email protected]> Co-authored-by: Ethan Furman <[email protected]>
Sorry, I have not had time yet to update the PR in this regard. Hence, I am a bit confused why this got merged already, @ethanfurman? 🤔 |
Woops, I missed that. Please create a new PR with the duplicate section removed from the How-To. |
Will do! |
…-136791) * Docs: Move Enum functions and add examples When the `Enum` functions `_add_alias_` and `_add_value_alias_` were added in de6bca9, the documentation for them was done under `EnumType` instead of `Enum`. This change moves them to the docs of the `Enum` class and adds an example for each function. --------- Co-authored-by: Ethan Furman <[email protected]>
To avoid duplicate content in the Enum HOWTO and API documentation which is not automatically synced, the section about supported __dunder__ and _sunder names is moved from HOWTO to API docs. See also python#136791
…) (#137688) Co-authored-by: RafaelWO <[email protected]> Co-authored-by: Ethan Furman <[email protected]>
To avoid duplicate content in the Enum HOWTO and API documentation which is not automatically synced, the section about supported __dunder__ and _sunder names is moved from HOWTO to API docs. See also python#136791
When the
Enum
functions_add_alias_
and_add_value_alias_
were added in de6bca9, the documentation for them was done underEnumType
instead ofEnum
.This change moves them to the docs of the
Enum
class and adds an example for each function.Additionally, it moves the
versionadded
forEnumType
to the top and fixes the indentation of anotherversionchanged
entry.📚 Documentation preview 📚: https://cpython-previews--136791.org.readthedocs.build/