Skip to content

[partially defined] fix false positive with global/nonlocal vars - #14222

Merged
ilinum merged 1 commit into
python:masterfrom
ilinum:partial/outer-scope
Nov 29, 2022
Merged

ilinum merged 1 commit into
python:masterfrom
ilinum:partial/outer-scope

Conversation

@ilinum

@ilinum ilinum commented Nov 29, 2022

Copy link
Copy Markdown
Collaborator

This is a workaround until we implement better handling for variables undefined in global scope (see #14213).

We treat global/nonlocal as a variable declaration. I've included test cases that should fail in the future once we implement the check properly.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@ilinum
ilinum merged commit 98f1b00 into python:master Nov 29, 2022
@ilinum
ilinum deleted the partial/outer-scope branch November 29, 2022 22:07
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.

2 participants