Skip to content

Commit b771360

Browse files
Apply suggestions from code review
Co-authored-by: Alex Waygood <[email protected]>
1 parent 0a353a6 commit b771360

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

Doc/howto/enum.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,6 @@ Supported ``_sunder_`` names
972972
- :attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a
973973
:class:`str`, that will not be transformed into members, and will be removed
974974
from the final class
975-
- :attr:`~Enum._order_` -- used in Python 2/3 code to ensure member order is
976-
consistent (class attribute, removed during class creation)
977975
- :meth:`~Enum._generate_next_value_` -- used to get an appropriate value for
978976
an enum member; may be overridden
979977

Doc/library/enum.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Data Types
235235
>>> len(Color)
236236
3
237237

238-
.. attribute: EnumType.__members__
238+
.. attribute:: EnumType.__members__
239239

240240
Returns a mapping of every enum name to its member, including aliases
241241

@@ -246,12 +246,12 @@ Data Types
246246
>>> list(reversed(Color))
247247
[<Color.BLUE: 3>, <Color.GREEN: 2>, <Color.RED: 1>]
248248

249-
.. method: EnumType._add_alias_
249+
.. method:: EnumType._add_alias_
250250

251251
Adds a new name as an alias to an existing member. Raises a
252252
:exc:`NameError` if the name is already assigned to a different member.
253253

254-
.. method: EnumType._add_value_alias_
254+
.. method:: EnumType._add_value_alias_
255255

256256
Adds a new value as an alias to an existing member. Raises a
257257
:exc:`ValueError` if the value is already linked with a different member.

Lib/enum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class EnumDict(dict):
334334
"""
335335
def __init__(self):
336336
super().__init__()
337-
self._member_names = {} # use a dict -- faster look-up than a list, and keeps insertion order since 3.7 (?)
337+
self._member_names = {} # use a dict -- faster look-up than a list, and keeps insertion order since 3.7
338338
self._last_values = []
339339
self._ignore = []
340340
self._auto_called = False

0 commit comments

Comments
 (0)