Skip to content

Commit ca683b9

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

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Doc/library/enum.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,9 +859,15 @@ 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+
865+
- ``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_
866+
862867
.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_``
863868
.. versionadded:: 3.7 ``_ignore_``
864-
.. versionadded:: 3.13 ``_add_alias_``, ``_add_value_alias_``
869+
.. versionadded:: 3.13 ``_add_alias_``, ``_add_value_alias_``, ``_repr_*``
870+
.. _`IPython's rich display`: https://ipython.readthedocs.io/en/stable/config/integrating.html#rich-display
865871

866872
---------------
867873

0 commit comments

Comments
 (0)