Skip to content

Commit 3b6a42c

Browse files
committed
Add comment to enum iteration test
1 parent 6e68941 commit 3b6a42c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test-data/unit/pythoneval.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,10 @@ _testNoCrashOnGenericUnionUnpacking.py:15: error: Revealed type is 'Union[builti
14601460
_testNoCrashOnGenericUnionUnpacking.py:16: error: Revealed type is 'Union[builtins.int*, builtins.str*]'
14611461

14621462
[case testEnumIteration]
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
14631467
from enum import Enum
14641468
class E(Enum):
14651469
A = 'a'

0 commit comments

Comments
 (0)