summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2021-03-03 17:54:30 (GMT)
committerGitHub <noreply@github.com>2021-03-03 17:54:30 (GMT)
commit44e580f448016b86807465a186d03d9074e2b589 (patch)
tree3fa55695ece25aac38893d2a38e05d0ff4386e98 /Doc
parent04f6fbb6969e9860783b9ab4dc24b6fe3c6dab8d (diff)
downloadcpython-44e580f448016b86807465a186d03d9074e2b589.zip
cpython-44e580f448016b86807465a186d03d9074e2b589.tar.gz
cpython-44e580f448016b86807465a186d03d9074e2b589.tar.bz2
bpo-43162: [Enum] update docs, renable doc tests (GH-24487)
* update docs, renable doc tests * make deprecation warning active for two releases
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/enum.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index b7f2694..73b77cb 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -1222,17 +1222,18 @@ Private names are not converted to Enum members, but remain normal attributes.
:class:`Enum` members are instances of their :class:`Enum` class, and are
normally accessed as ``EnumClass.member``. In Python versions ``3.5`` to
``3.9`` you could access members from other members -- this practice was
-discouraged, and in ``3.10`` :class:`Enum` has returned to not allowing it::
+discouraged, and in ``3.12`` :class:`Enum` will return to not allowing it,
+while in ``3.10`` and ``3.11`` it will raise a :exc:`DeprecationWarning`::
>>> class FieldTypes(Enum):
... name = 0
... value = 1
... size = 2
...
- >>> FieldTypes.value.size
- Traceback (most recent call last):
- ...
- AttributeError: FieldTypes: no attribute 'size'
+ >>> FieldTypes.value.size # doctest: +SKIP
+ DeprecationWarning: accessing one member from another is not supported,
+ and will be disabled in 3.12
+ <FieldTypes.size: 2>
.. versionchanged:: 3.5
.. versionchanged:: 3.10