8000
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 f8bb74a commit 7334c8fCopy full SHA for 7334c8f
mypy/test/data/check-inference.test
@@ -1295,3 +1295,23 @@ def f() -> None:
1295
x = None
1296
x = 1
1297
x() # E: None not callable
1298
+
1299
+[case testAttributePartiallyInitializedToNone]
1300
+class A:
1301
+ def f(self) -> None:
1302
+ self.x = None
1303
+ self.x = 1
1304
+ self.x() # E: "int" not callable
1305
+[out]
1306
+main: note: In member "f" of class "A":
1307
1308
+[case testAttributePartiallyInitializedToNoneWithMissingAnnotation]
1309
1310
1311
+ self.x = None # E: Need type annotation for variable
1312
1313
+ def g(self) -> None:
1314
1315
+ self.x()
1316
1317
0 commit comments