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 17b68c6 commit 7bd951aCopy full SHA for 7bd951a
test-data/unit/check-newsemanal.test
@@ -2756,3 +2756,21 @@ def g() -> None:
2756
x = f() # E: Need type annotation for 'x'
2757
y = x
2758
reveal_type(y) # N: Revealed type is '__main__.G[Any]'
2759
+
2760
+[case testNewAnalyzerRedefinedNonlocal]
2761
+import typing
2762
2763
+def f():
2764
+ bar = [] # type: typing.List[int]
2765
2766
+ def foo():
2767
+ nonlocal bar
2768
2769
2770
+def g() -> None:
2771
2772
2773
+ def foo() -> None:
2774
2775
+ bar = [] # type: typing.List[int] # E: Name 'bar' already defined on line 11
2776
+[builtins fixtures/list.pyi]
0 commit comments