We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from enum import IntEnum Color = IntEnum('Color', 'red green blue') Color['green']
...yields:
test.py:3: error: Value of type "Type[Color]" is not indexable
This example is more or less straight out of the enum docs -- my expectation is that it should not be a type error.
Mypy version 025e3de
The text was updated successfully, but these errors were encountered:
Note that this problem is absent for a simple Enum. Also IntEnum fails the following code:
Enum
IntEnum
for c in Color: # E: not iterable reveal_type(c)
I thought this should be fixed by #4319 @elazarg what do you think?
Sorry, something went wrong.
It only happens for functional api of non-Enum enums. I will look into it.
I am experiencing this with mypy==0.780, with similar errors:
mypy==0.780
"IntEnum" not callable "IntEnum" is not indexable
When doing:
val = self.enum_class(value) val = self.enum_class[value.upper()]
No branches or pull requests
...yields:
This example is more or less straight out of the enum docs -- my expectation is that it should not be a type error.
Mypy version 025e3de
The text was updated successfully, but these errors were encountered: