mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-92120: The docstring of enum.Enum is invalid in reST (GH-92122)
Closes #92120
This commit is contained in:
parent
dc8a86893d
commit
90d5c9b195
2 changed files with 8 additions and 7 deletions
14
Lib/enum.py
14
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:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue