gh-136672: Docs: Move Enum functions and add examples#136791
gh-136672: Docs: Move Enum functions and add examples#136791ethanfurman merged 4 commits intopython:mainfrom
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
ethanfurman
left a comment
There was a problem hiding this comment.
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 |
|
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. |
|
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 <38643099+RafaelWO@users.noreply.github.com> Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
…-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 <38643099+RafaelWO@users.noreply.github.com> Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
|
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. |
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 <ethan@stoneleaf.us>
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
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
…-139176) 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 (cherry picked from commit 629a363) Co-authored-by: Rafael Weingartner-Ortner <38643099+RafaelWO@users.noreply.github.com>
…-139176) 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 (cherry picked from commit 629a363) Co-authored-by: Rafael Weingartner-Ortner <38643099+RafaelWO@users.noreply.github.com>
When the
Enumfunctions_add_alias_and_add_value_alias_were added in de6bca9, the documentation for them was done underEnumTypeinstead ofEnum.This change moves them to the docs of the
Enumclass and adds an example for each function.Additionally, it moves the
versionaddedforEnumTypeto the top and fixes the indentation of anotherversionchangedentry.📚 Documentation preview 📚: https://cpython-previews--136791.org.readthedocs.build/