Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-110679: Improved markup in enum.rst #110747

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

Merged
merged 5 commits into from
Oct 25, 2023
Merged

Conversation

khlmood
Copy link
Contributor

@khlmood khlmood commented Oct 12, 2023

After reviewing file, I noticed several instances where the documentation used italic formatting instead of the appropriate role formatting. I've made corrections to these instances to improve the markup.


📚 Documentation preview 📚: https://cpython-previews--110747.org.readthedocs.build/

@khlmood khlmood requested a review from ethanfurman as a code owner October 12, 2023 01:17
@ghost
Copy link

ghost commented Oct 12, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news awaiting review labels Oct 12, 2023
@@ -161,13 +161,13 @@ Data Types

.. class:: EnumType

*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible
:class:`EnumType` is the :term:`metaclass` for :class:`enum` enumerations. It is possible
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linking EnumType here is ugly as the link would lead right back to the current paragraph. We probably should use code formatting, but not a link.

enum I believe refers to the module, not to a class—there is no class called enum. There too, I don't think a link is helpful.

@@ -405,9 +405,9 @@ Data Types

.. class:: IntEnum

*IntEnum* is the same as *Enum*, but its members are also integers and can be
:class:`IntEnum` is the same as :class:`Enum`, but its members are also integers and can be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here (and several times below), it's again not helpful to add a link back to the current paragraph.

than the highest value; for *StrEnum* it will be the lower-cased version of
:class:`auto` can be used in place of a value. If used, the *Enum* machinery will
call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an appropriate value.
For :class:`Enum` and :class:`IntEnum`` that appropriate value will be the last value plus
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For :class:`Enum` and :class:`IntEnum`` that appropriate value will be the last value plus
For :class:`Enum` and :class:`IntEnum` that appropriate value will be the last value plus

@khlmood
Copy link
Contributor Author

khlmood commented Oct 13, 2023

Thank you @JelleZijlstra for your valuable feedback.

@@ -165,7 +165,7 @@ Data Types
to subclass *EnumType* -- see :ref:`Subclassing EnumType <enumtype-examples>`
for details.

*EnumType* is responsible for setting the correct :meth:`!__repr__`,
:class:`EnumType` is responsible for setting the correct :meth:`!__repr__`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:class:`EnumType` is responsible for setting the correct :meth:`!__repr__`,
``EnumType`` is responsible for setting the correct :meth:`!__repr__`,

@@ -437,7 +437,7 @@ Data Types

.. class:: StrEnum

*StrEnum* is the same as *Enum*, but its members are also strings and can be used
*StrEnum* is the same as :class:`Enum`, but its members are also strings and can be used
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*StrEnum* is the same as :class:`Enum`, but its members are also strings and can be used
``StrEnum`` is the same as :class:`Enum`, but its members are also strings and can be used

@@ -576,7 +576,7 @@ Data Types

.. class:: IntFlag

*IntFlag* is the same as *Flag*, but its members are also integers and can be
*IntFlag* is the same as :class:`Flag`, but its members are also integers and can be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*IntFlag* is the same as :class:`Flag`, but its members are also integers and can be
``IntFlag`` is the same as :class:`Flag`, but its members are also integers and can be

@@ -697,7 +697,7 @@ Data Types

.. class:: FlagBoundary

*FlagBoundary* controls how out-of-range values are handled in *Flag* and its
*FlagBoundary* controls how out-of-range values are handled in :class:`Flag` and its
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*FlagBoundary* controls how out-of-range values are handled in :class:`Flag` and its
``FlagBoundary`` controls how out-of-range values are handled in :class:`Flag` and its

@bedevere-app
Copy link

bedevere-app bot commented Oct 25, 2023

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Made requested changes regarding markup.
@ethanfurman ethanfurman merged commit 14f52e1 into python:main Oct 25, 2023
Copy link
Member

@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit late to the party, but the correct way to format those examples without generating a link would be :class:`!EnumType`. The output of this will consistent with the other :class: without creating an unnecessary link.

@khlmood khlmood deleted the gh-110679 branch November 2, 2023 16:41
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants