-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
To Reproduce
from enum import Enum
class E(Enum):
A = 1
B = 2
A, B = E
Actual Behavior
This code generates an error:
$ mypy --strict proj/iter_enum.py
proj/iter_enum.py:7: error: "Type[E]" object is not iterable [misc]
Expected Behavior
This should type check without errors. Note that mypy knows that E
is actually iterable. For example,
A, B = list(E)
works fine and so does iterating over E
in a for loop.
Your Environment
- Mypy version used:
mypy 1.1.0+dev.c23e831ab0e7ec827c38cc830d3ebd3f4c43cd75
- Mypy command-line flags: with and without
--strict
- Python version used: 3.10.6