ID EN
Enum

__getitem__

Python 3.11

Returns the Enum member in cls matching name, or raises a KeyError:

Syntax

PYTHON
__getitem__(cls, name)

Examples

Example 1
PYTHON
>>> Color['BLUE']
<Color.BLUE: 3>

See Also

KeyError