Skip to content

used-before-assignment and undefined-loop-variable false positives with regard to function annotation #1082

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
PCManticore opened this issue Aug 23, 2016 · 0 comments · Fixed by #3713
Labels

Comments

@PCManticore
Copy link
Contributor

Given a function such as the following, we are getting used-before-assignment and undefined-loop-variable for the annotation, while we should retrieve an undefined-variable message, since the variable is actually not defined there.


def test(a:x):
   if x == 2:
      for x in [1, 2]:
          pass
Pierre-Sassoulas pushed a commit that referenced this issue Jul 12, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
)

Fix scoping for function annotations, decorators and base classes

Closes #1082, #3434, #3461

Reduce number of branches in variables checker

Co-authored-by: Andrew Simmons <a.simmons@deakin.edu.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant