summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchrysn <chrysn@fsfe.org>2024-05-07 18:11:18 (GMT)
committerGitHub <noreply@github.com>2024-05-07 18:11:18 (GMT)
commitf58833ebf8161aaa33844d63fb51b1575180cfbb (patch)
treeaa19c49b76bdaf933055e99151c361502acc51c8
parentb9caa0977c512a5e7966ebfdc64fabdc4f3e4971 (diff)
downloadcpython-f58833ebf8161aaa33844d63fb51b1575180cfbb.zip
cpython-f58833ebf8161aaa33844d63fb51b1575180cfbb.tar.gz
cpython-f58833ebf8161aaa33844d63fb51b1575180cfbb.tar.bz2
gh-118650: Document `Enum._repr_*` reservation exclusion (GH-118698)
-rw-r--r--Doc/library/enum.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 6837b45..21f41b7 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -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
---------------