Skip to content

Multiple issues with enum __add_(value_)alias_ documentation #136672

@srittau

Description

@srittau

Documentation

Enum._add_alias_ and _add_value_alias_ were added in Python 3.13, but this is not clearly pointed out in the documentation:

https://docs.python.org/3/library/enum.html#enum.EnumType._add_alias_

There is an "Added in version 3.13" marker way down in the Supported _sunder_ names section, but this is unlikely to be discovered by someone looking at the documentation here.

Also, these methods are documented as being members of EnumType, while in reality, they are members of Enum:

Python 3.13.3 (main, Apr 11 2025, 16:08:36) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import enum
>>> enum.EnumType._add_alias_
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    enum.EnumType._add_alias_
AttributeError: type object 'EnumType' has no attribute '_add_alias_'
>>> enum.Enum._add_alias_
<function Enum._add_alias_ at 0x784229e71120>

Finally, examples for these functions would help to understand their purpose.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions