Skip to content

Added conditional check for function scope in 'SemanticAnalyzer.looku… #12777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

ritikBhandari
Copy link

Fixes #12764

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

bidict (https://github.com/jab/bidict)
+ bidict/_named.py: note: In function "namedbidict":
+ bidict/_named.py:75:19: error: Name "get_keyname" is not defined  [name-defined]
+ bidict/_named.py:76:19: error: Name "get_valname" is not defined  [name-defined]

pydantic (https://github.com/samuelcolvin/pydantic)
+ pydantic/decorator.py:222: error: Name "self" is not defined  [name-defined]
+ pydantic/decorator.py:229: error: Name "self" is not defined  [name-defined]

pandera (https://github.com/pandera-dev/pandera)
+ tests/strategies/test_strategies.py:398: error: Name "custom_eq_strategy" is not defined  [name-defined]
+ tests/strategies/test_strategies.py:429: error: Name "custom_strat" is not defined  [name-defined]
+ tests/strategies/test_strategies.py:429: note: Error code "name-defined" not covered by "type: ignore" comment
+ tests/strategies/test_strategies.py:438: error: Incompatible return value type (got "tests.strategies.test_strategies.CustomCheck@425", expected "tests.strategies.test_strategies.CustomCheck@394")  [return-value]
+ tests/core/test_model.py:635: error: Name "check_vals" is not defined  [name-defined]
+ tests/core/test_model.py:639: error: Name "check_vals" is not defined  [name-defined]
+ tests/core/test_model.py:641: error: Name "check_vals" is not defined  [name-defined]
+ tests/core/test_model.py:642: error: Name "check_vals" is not defined  [name-defined]
+ tests/core/test_model.py:1015: error: Name "T" is not defined  [name-defined]
+ tests/core/test_model.py:1048: error: Name "T" is not defined  [name-defined]
+ tests/core/test_model.py:1077: error: Name "T" is not defined  [name-defined]
+ tests/core/test_model.py:1103: error: Name "T" is not defined  [name-defined]
+ tests/core/test_model.py:1106: error: Name "T" is not defined  [name-defined]
+ tests/core/test_model.py:1155: error: Name "T1" is not defined  [name-defined]
+ tests/core/test_model.py:1156: error: Name "T2" is not defined  [name-defined]
+ tests/core/test_model.py:1191: error: Name "T1" is not defined  [name-defined]
+ tests/core/test_model.py:1192: error: Name "T2" is not defined  [name-defined]
+ tests/core/test_decorators.py:217: error: Name "in_schema" is not defined  [name-defined]
+ tests/core/test_decorators.py:218: error: Name "out_schema" is not defined  [name-defined]
+ tests/core/test_decorators.py:222: error: Name "in_schema" is not defined  [name-defined]
+ tests/core/test_decorators.py:223: error: Name "out_schema" is not defined  [name-defined]
+ tests/core/test_decorators.py:227: error: Name "in_schema" is not defined  [name-defined]
+ tests/core/test_decorators.py:228: error: Name "out_schema" is not defined  [name-defined]
+ tests/core/test_decorators.py:232: error: Name "in_schema" is not defined  [name-defined]
+ tests/core/test_decorators.py:233: error: Name "out_schema" is not defined  [name-defined]
+ tests/core/test_decorators.py:237: error: Name "in_schema" is not defined  [name-defined]
+ tests/core/test_decorators.py:238: error: Name "out_schema" is not defined  [name-defined]

psycopg (https://github.com/psycopg/psycopg)
+ tests/test_sql.py:375: error: Name "info" is not defined  [name-defined]
+ psycopg/psycopg/types/shapely.py:86: error: Name "info" is not defined  [name-defined]
+ psycopg/psycopg/types/shapely.py:89: error: Name "info" is not defined  [name-defined]
+ psycopg/psycopg/types/hstore.py:126: error: Name "info" is not defined  [name-defined]

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/trade.py:330: error: Name "self" is not defined  [name-defined]
- steam/http.py:114: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- steam/http.py:180: error: Variable "steam.http.StrOrURL" is not valid as a type  [valid-type]
- steam/http.py:180: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- steam/http.py:183: error: Variable "steam.http.StrOrURL" is not valid as a type  [valid-type]
- steam/http.py:183: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- steam/review.py:170: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
+ steam/http.py:114: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/debugging.py:157: error: Name "capman" is not defined  [name-defined]
+ src/_pytest/pytester.py:1150: error: Name "ret" is not defined  [name-defined]
+ testing/test_terminal.py:1310: error: Name "_REPORTCHARS_DEFAULT" is not defined  [name-defined]
+ testing/test_terminal.py:2337: error: Name "width" is not defined  [name-defined]
+ testing/test_nodes.py:124: error: Name "cwd" is not defined  [name-defined]
+ testing/test_nodes.py:133: error: Name "cwd" is not defined  [name-defined]
+ testing/test_config.py:439: error: Name "plugin_version" is not defined  [name-defined]
+ testing/test_config.py:994: error: Missing positional arguments "name", "module" in call to "DummyEntryPoint"  [call-arg]
+ testing/test_config.py:1021: error: Missing positional arguments "name", "module" in call to "DummyEntryPoint"  [call-arg]
+ testing/test_config.py:1049: error: Missing positional arguments "name", "module" in call to "DummyEntryPoint"  [call-arg]
+ testing/test_config.py:1086: error: Missing positional arguments "name", "module" in call to "DummyEntryPoint"  [call-arg]
+ testing/test_assertrewrite.py:1361: error: Name "self" is not defined  [name-defined]
+ Deferral trace:
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+     conftest:199
+     conftest:199
+     conftest:-1
+ testing/conftest.py: error: INTERNAL ERROR: maximum semantic analysis iteration count reached

porcupine (https://github.com/Akuli/porcupine)
+ porcupine/settings.py:78: error: Name "type_" is not defined  [name-defined]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/parsers/python_parser.py:185: error: Name "self" is not defined  [name-defined]
+ pandas/io/parsers/python_parser.py:186: error: Name "self" is not defined  [name-defined]
+ pandas/io/parsers/python_parser.py:187: error: Name "self" is not defined  [name-defined]
+ pandas/io/parsers/python_parser.py:188: error: Name "self" is not defined  [name-defined]
+ pandas/io/parsers/python_parser.py:189: error: Name "self" is not defined  [name-defined]
+ pandas/io/parsers/python_parser.py:190: error: Name "self" is not defined  [name-defined]
+ pandas/io/formats/style.py:3599: error: Name "loader" is not defined  [name-defined]
+ pandas/io/formats/style.py:3600: error: Name "html_table" is not defined  [name-defined]
+ pandas/io/formats/style.py:3601: error: Name "html_table" is not defined  [name-defined]
+ pandas/io/formats/style.py:3602: error: Name "html_style" is not defined  [name-defined]
+ pandas/io/formats/style.py:3603: error: Name "html_style" is not defined  [name-defined]

streamlit (https://github.com/streamlit/streamlit)
- lib/streamlit/forward_msg_queue.py:106:107: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
+ lib/streamlit/error_util.py:33:34: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)

@hauntsaninja hauntsaninja marked this pull request as draft May 20, 2022 01:25
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Name in class def is resolved in enclosing function, instead of global, scope.
1 participant