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 93a1874 commit 67d84aaCopy full SHA for 67d84aa
test-data/unit/check-inference.test
@@ -2307,10 +2307,17 @@ class C:
2307
-- Special case for assignment to '_'
2308
-- ----------------------------------
2309
2310
-[case testUnusedTargetSingle]
+[case testUnusedTargetLocal]
2311
def foo() -> None:
2312
_ = 0
2313
_ = ''
2314
+
2315
+[case testUnusedTargetGlobal]
2316
+_ = 0
2317
+_ = ''
2318
2319
+[case testUnusedTargetClass]
2320
+class C:
2321
2322
2323
@@ -2369,7 +2376,7 @@ _().method() # E: "_" has no attribute "method"
2369
2376
[case testUnusedTargetNotDef]
2370
2377
def _() -> int:
2371
2378
pass
2372
-_() + 0
2379
+_() + '' # E: Unsupported operand types for + ("int" and "str")
2373
2380
2374
2381
[case testUnusedTargetForLoop]
2375
2382
def f() -> None:
0 commit comments