-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Conversation
Doc/library/enum.rst
Outdated
@@ -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 |
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.
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.
Doc/library/enum.rst
Outdated
@@ -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 |
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.
Here (and several times below), it's again not helpful to add a link back to the current paragraph.
Doc/library/enum.rst
Outdated
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 |
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.
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 |
Thank you @JelleZijlstra for your valuable feedback. |
Doc/library/enum.rst
Outdated
@@ -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__`, |
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.
:class:`EnumType` is responsible for setting the correct :meth:`!__repr__`, | |
``EnumType`` is responsible for setting the correct :meth:`!__repr__`, |
Doc/library/enum.rst
Outdated
@@ -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 |
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.
*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 |
Doc/library/enum.rst
Outdated
@@ -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 |
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.
*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 |
Doc/library/enum.rst
Outdated
@@ -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 |
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.
*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 |
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 |
Made requested changes regarding markup.
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'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.
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.
enum.rst
#110679📚 Documentation preview 📚: https://cpython-previews--110747.org.readthedocs.build/