-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
Documentation
The doc currently says:
class enum.EnumType
[...]
__contains__(cls, member)
ReturnsTrue
ifmember
belongs to thecls
:
>>> some_var = Color.RED
>>> some_var in Color
True
Note: In Python 3.12 it will be possible to check for member values and not just members; until then, aTypeError
will be raised if a non-Enum-member is used in a containment check.
Python 3.12 has already been released, so this note block should be replaced with a Changed in version 3.12 note:
Changed in version 3.12: Before Python 3.12, a
TypeError
is raised if a non-Enum-member is used in a containment check.
Linked PRs
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir