@@ -251,16 +251,6 @@ Data Types
251251 >>> list(reversed(Color))
252252 [<Color.BLUE: 3>, <Color.GREEN: 2>, <Color.RED: 1>]
253253
254- .. method :: EnumType._add_alias_
255-
256- Adds a new name as an alias to an existing member. Raises a
257- :exc: `NameError ` if the name is already assigned to a different member.
258-
259- .. method :: EnumType._add_value_alias_
260-
261- Adds a new value as an alias to an existing member. Raises a
262- :exc: `ValueError ` if the value is already linked with a different member.
263-
264254 .. versionadded :: 3.11
265255
266256 Before 3.11 ``EnumType `` was called ``EnumMeta ``, which is still available as an alias.
@@ -470,6 +460,30 @@ Data Types
470460
471461 .. versionchanged :: 3.12 Added :ref:`enum-dataclass-support`
472462
463+ .. method :: Enum._add_alias_
464+
465+ Adds a new name as an alias to an existing member::
466+
467+ >>> Color._add_alias_(Color.RED, "ERROR")
468+ >>> Color.ERROR
469+ <Color.RED: 1>
470+
471+ Raises a :exc: `NameError ` if the name is already assigned to a different member.
472+
473+ .. versionadded :: 3.13
474+
475+ .. method :: Enum._add_value_alias_
476+
477+ Adds a new value as an alias to an existing member::
478+
479+ >>> Color._add_value_alias_(Color.RED, 42)
480+ >>> Color(42)
481+ <Color.RED: 1>
482+
483+ Raises a :exc: `ValueError ` if the value is already linked with a different member.
484+
485+ .. versionadded :: 3.13
486+
473487
474488.. class :: IntEnum
475489
@@ -864,9 +878,9 @@ Once all the members are created it is no longer used.
864878Supported ``_sunder_ `` names
865879""""""""""""""""""""""""""""
866880
867- - :meth: `~EnumType ._add_alias_ ` -- adds a new name as an alias to an existing
881+ - :meth: `~Enum ._add_alias_ ` -- adds a new name as an alias to an existing
868882 member.
869- - :meth: `~EnumType ._add_value_alias_ ` -- adds a new value as an alias to an
883+ - :meth: `~Enum ._add_value_alias_ ` -- adds a new value as an alias to an
870884 existing member.
871885- :attr: `~Enum._name_ ` -- name of the member
872886- :attr: `~Enum._value_ ` -- value of the member; can be set in ``__new__ ``
0 commit comments