[Python-checkins] gh-92120: The docstring of enum.Enum is invalid in reST (GH-92122)
ethanfurman
webhook-mailer at python.org
Wed Dec 7 21:24:58 EST 2022
https://github.com/python/cpython/commit/90d5c9b195a8133688c2d7b6ad9e0ca8b76df1df
commit: 90d5c9b195a8133688c2d7b6ad9e0ca8b76df1df
branch: main
author: Takeshi KOMIYA <i.tkomiya at gmail.com>
committer: ethanfurman <ethan at stoneleaf.us>
date: 2022年12月07日T18:24:52-08:00
summary:
gh-92120: The docstring of enum.Enum is invalid in reST (GH-92122)
Closes #92120
files:
A Misc/NEWS.d/next/Library/2022-05-06-01-53-34.gh-issue-92122.96Lf2p.rst
M Lib/enum.py
diff --git a/Lib/enum.py b/Lib/enum.py
index f07b821f1a60..b2f7b9f8d4ad 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -1054,20 +1054,20 @@ class Enum(metaclass=EnumType):
Access them by:
- - attribute access::
+ - attribute access:
- >>> Color.RED
- <Color.RED: 1>
+ >>> Color.RED
+ <Color.RED: 1>
- value lookup:
- >>> Color(1)
- <Color.RED: 1>
+ >>> Color(1)
+ <Color.RED: 1>
- name lookup:
- >>> Color['RED']
- <Color.RED: 1>
+ >>> Color['RED']
+ <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
diff --git a/Misc/NEWS.d/next/Library/2022-05-06-01-53-34.gh-issue-92122.96Lf2p.rst b/Misc/NEWS.d/next/Library/2022-05-06-01-53-34.gh-issue-92122.96Lf2p.rst
new file mode 100644
index 000000000000..d585535ee38d
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-05-06-01-53-34.gh-issue-92122.96Lf2p.rst
@@ -0,0 +1 @@
+Fix reStructuredText syntax errors in docstrings in the :mod:`enum` module.
More information about the Python-checkins
mailing list