File tree 1 file changed +3
-6
lines changed 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -1459,20 +1459,17 @@ _testNoCrashOnGenericUnionUnpacking.py:11: error: Revealed type is 'Union[builti
1459
1459
_testNoCrashOnGenericUnionUnpacking.py:15: error: Revealed type is 'Union[builtins.int*, builtins.str*]'
1460
1460
_testNoCrashOnGenericUnionUnpacking.py:16: error: Revealed type is 'Union[builtins.int*, builtins.str*]'
1461
1461
1462
- [case testEnumIteration ]
1462
+ [case testEnumIterationAndPreciseElementType ]
1463
1463
# Regression test for #2305
1464
- # Tests that:
1465
- # - Mypy allows iteration over enum classes in comprehensions and for-loops
1466
- # - The inferred element type in such iteration contexts is the enum type
1467
1464
from enum import Enum
1468
1465
class E(Enum):
1469
1466
A = 'a'
1470
1467
(reveal_type(e) for e in E)
1471
1468
for e in E:
1472
1469
reveal_type(e)
1473
1470
[out]
1474
- _testEnumIteration.py:8 : error: Revealed type is '_testEnumIteration.E*'
1475
- _testEnumIteration.py:10 : error: Revealed type is '_testEnumIteration.E*'
1471
+ _testEnumIteration.py:5 : error: Revealed type is '_testEnumIteration.E*'
1472
+ _testEnumIteration.py:7 : error: Revealed type is '_testEnumIteration.E*'
1476
1473
1477
1474
[case testEnumIterable]
1478
1475
from enum import Enum
You can’t perform that action at this time.
0 commit comments