We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b1bba2 commit 5998612Copy full SHA for 5998612
1 file changed
mypy/nested-class-scope.py
@@ -0,0 +1,12 @@
1
+from typing import *
2
+
3
+x: Optional[int] = None
4
+y: Optional[int] = None
5
6
+def f() -> None:
7
+ x = 1
8
+ y = 1
9
+ class C:
10
+ reveal_type(x) # Incorrectly reveals int, should be Optional[int]
11
+ reveal_type(y) # Correctly reveals int
12
+ x = 2
0 commit comments