Closed
Description
Assume this definition of Color
:
from enum import Enum
class Color(Enum):
red = 1
green = 2
blue = 3
Now this should be valid, but mypy complains about it:
Color['red']
The error message indicates that mypy thinks that the programmer is trying to construct a generic type, which is not the case here:
$ mypy t.py
t.py:8: error: Name 'red' is not defined