Skip to content

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

Closed

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

Activity

  1. added
    docs
    on Jul 15, 2025
  2. amentee commented on Jul 15, 2025

    @amentee

    @srittau - There is an example mentioned in the enum cookbook here - https://docs.python.org/3/howto/enum.html#multivalueenum . But yes agreed , in the original documentation these methods are documented as part of EnumType.

  3. RafaelWO commented on Jul 19, 2025

    @RafaelWO
    Contributor

    I would like to take a look at this and potentially open a PR 👀

  4. added a commit that references this issue on Aug 12, 2025
  5. added 2 commits that reference this issue on Aug 12, 2025
  6. added a commit that references this issue on Aug 12, 2025
  7. added a commit that references this issue on Aug 19, 2025
  8. added a commit that references this issue on Sep 11, 2025
  9. added a commit that references this issue on Feb 13, 2026
  10. added 2 commits that reference this issue on Feb 13, 2026
  11. added a commit that references this issue on Feb 28, 2026
  12. added 2 commits that reference this issue on Mar 23, 2026
  13. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docs

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions