From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:52:17 +0000 (+0200) Subject: [3.12] GH-111182: Update EnumType.__contains__ docs (GH-111184) (GH-111281) X-Git-Tag: v3.12.1~227 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a28aa10a867a71261b671ffbb52dea594049bf5;p=thirdparty%2FPython%2Fcpython.git [3.12] GH-111182: Update EnumType.__contains__ docs (GH-111184) (GH-111281) GH-111182: Update EnumType.__contains__ docs (GH-111184) (cherry picked from commit c0ea67dd0d67a8ac59c61c777eae26288d3ac0f6) Co-authored-by: InSync <122007197+InSyncWithFoo@users.noreply.github.com> --- diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 487dace78c72..57e1f581d4ea 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -198,11 +198,12 @@ Data Types >>> some_var = Color.RED >>> some_var in Color True + >>> Color.RED.value in Color + True - .. note:: + .. versionchanged:: 3.12 - In Python 3.12 it will be possible to check for member values and not - just members; until then, a ``TypeError`` will be raised if a + Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used in a containment check. .. method:: EnumType.__dir__(cls)