-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Pylint fails to detect NameError from type hint #3771
Comments
DanielNoord
added a commit
to DanielNoord/pylint
that referenced
this issue
Oct 18, 2021
… and defaults This closes pylint-dev#3771
4 tasks
cdce8p
added a commit
to cdce8p/pylint
that referenced
this issue
Oct 21, 2021
Squashed commit of the following: commit 3d7d5d3 Merge: f7333e2 27cabbb Author: Pierre Sassoulas <pierre.sassoulas@gmail.com> Date: Tue Oct 19 13:26:45 2021 +0200 Merge branch 'main' into undefined-variable commit f7333e2 Merge: 63e34c0 8e6cd18 Author: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Date: Mon Oct 18 22:37:39 2021 +0200 Merge branch 'undefined-variable' of https://github.com/DanielNoord/pylint into undefined-variable commit 63e34c0 Author: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Date: Mon Oct 18 22:36:32 2021 +0200 Handle `annotations` import commit 8e6cd18 Merge: c45d82e cd5838c Author: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Date: Mon Oct 18 22:02:14 2021 +0200 Merge branch 'main' into undefined-variable commit c45d82e Author: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Date: Mon Oct 18 20:32:06 2021 +0200 Update name and docstring commit 0f87c0e Author: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Date: Mon Oct 18 17:45:51 2021 +0200 Make ``used-before-assignment`` consider classes in method annotation and defaults This closes pylint-dev#3771
cdce8p
added a commit
to cdce8p/pylint
that referenced
this issue
Oct 21, 2021
Squashed commit of the following: commit 3d7d5d3 Merge: f7333e2 27cabbb Author: Pierre Sassoulas <pierre.sassoulas@gmail.com> Date: Tue Oct 19 13:26:45 2021 +0200 Merge branch 'main' into undefined-variable commit f7333e2 Merge: 63e34c0 8e6cd18 Author: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Date: Mon Oct 18 22:37:39 2021 +0200 Merge branch 'undefined-variable' of https://github.com/DanielNoord/pylint into undefined-variable commit 63e34c0 Author: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Date: Mon Oct 18 22:36:32 2021 +0200 Handle `annotations` import commit 8e6cd18 Merge: c45d82e cd5838c Author: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Date: Mon Oct 18 22:02:14 2021 +0200 Merge branch 'main' into undefined-variable commit c45d82e Author: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Date: Mon Oct 18 20:32:06 2021 +0200 Update name and docstring commit 0f87c0e Author: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Date: Mon Oct 18 17:45:51 2021 +0200 Make ``used-before-assignment`` consider classes in method annotation and defaults This closes pylint-dev#3771
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Pylint the following code:
Current behavior
Pylint is perfectly happy:
Python is not:
Expected behavior
Since this code will apparently never run, I would expect that pylint would return an undefined-variable error, matching the interpreter's actions.
Interestingly, if I change the line to include a misspelling, pylint catches it:
yields:
pylint --version output
The text was updated successfully, but these errors were encountered: