]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118650: Document `Enum._repr_*` reservation exclusion (GH-118698)
authorchrysn <chrysn@fsfe.org>
Tue, 7 May 2024 18:11:18 +0000 (20:11 +0200)
committerGitHub <noreply@github.com>
Tue, 7 May 2024 18:11:18 +0000 (11:11 -0700)
Doc/library/enum.rst

index 6837b45894b3a92f015d56b6ea034216a8b18cec..21f41b73086c9804d3b02ee172ffd4af6ba4bbb7 100644 (file)
@@ -861,9 +861,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
 
 ---------------