8000 gh-118650: Document `Enum._repr_*` reservation exclusion by chrysn · Pull Request #118698 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-118650: Document Enum._repr_* reservation exclusion #118698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -859,9 +859,15 @@ Supported ``_sunder_`` names
For :class:`Flag` classes the next value chosen will be the next highest
power-of-two.

- While ``_sunder_`` names are generally reserved for the further development
of the :class:`Enum` class and can not be used, some are explicitly allowed:

- ``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_

.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_``
.. versionadded:: 3.7 ``_ignore_``
.. versionadded:: 3.13 ``_add_alias_``, ``_add_value_alias_``
.. versionadded:: 3.13 ``_add_alias_``, ``_add_value_alias_``, ``_repr_*``
.. _`IPython's rich display`: https://ipython.readthedocs.io/en/stable/config/integrating.html#rich-display

---------------

Expand Down
Loading
0