Suppose we have an Enum called MyEnum, and we try something like MyEnum["foo"], mypy will give us an error Value of type "MyEnum" is not indexable. We believe this is because mypy has trouble recognizing when a metaclass implements __getitem__.
A workaround is to do getattr(MyEnum, "foo"), but it'd be nice to have an actual fix.
Suppose we have an
EnumcalledMyEnum, and we try something likeMyEnum["foo"], mypy will give us an errorValue of type "MyEnum" is not indexable. We believe this is because mypy has trouble recognizing when a metaclass implements__getitem__.A workaround is to do
getattr(MyEnum, "foo"), but it'd be nice to have an actual fix.