Skip to content

Commit f58833e

Browse files
authored
gh-118650: Document Enum._repr_* reservation exclusion (GH-118698)
1 parent b9caa09 commit f58833e

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
@@ -861,9 +861,15 @@ Supported ``_sunder_`` names
861861
For :class:`Flag` classes the next value chosen will be the next highest
862862
power-of-two.
863863

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

868874
---------------
869875

0 commit comments

Comments
 (0)