Skip to content

Commit b8d20a8

Browse files
committed
gh-118650: Document Enum._repr_* reservation exclusion
1 parent 1e42842 commit b8d20a8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Doc/library/enum.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,9 +859,14 @@ Supported ``_sunder_`` names
859859
For :class:`Flag` classes the next value chosen will be the next highest
860860
power-of-two.
861861

862+
- While ``_sunder_`` names are generally reserved for the further development
863+
of the :class:`Enum` class and can not be used, some are explicitly allowed:
864+
- ``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_
865+
862866
.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_``
863867
.. versionadded:: 3.7 ``_ignore_``
864-
.. versionadded:: 3.13 ``_add_alias_``, ``_add_value_alias_``
868+
.. versionadded:: 3.13 ``_add_alias_``, ``_add_value_alias_``, ``_repr_*``
869+
.. _`IPython's rich display`: https://ipython.readthedocs.io/en/stable/config/integrating.html#rich-display
865870

866871
---------------
867872

0 commit comments

Comments
 (0)