-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Emit used-before-assignment
for further imports guarded by TYPE_CHECKING
#7806
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
Conversation
β¦CKING Previously, this message was only emitted for imports guarded directly under TYPE_CHECKING, not guarded two if-branches deep, nor when TYPE_CHECKING was imported from typing under an alias.
Pull Request Test Coverage Report for Build 3548460782
π - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in_type_checking_block
is indeed a lot more accurate π
This comment has been minimized.
This comment has been minimized.
The false positive in flask is already documented at #7609. It's true that this PR will ever so slightly drive more traffic into that false positive, but I don't think that's a reason not to merge it, because whenever someone picks it up, we'll immediately backport it. EDIT: I opened #7810 to fix it |
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit f9fea0f |
@Pierre-Sassoulas This one's ready for review, if you get a chance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM π Thanks for the reminder !
Type of Changes
Description
Previously, this message was only emitted for imports guarded directly under TYPE_CHECKING, not guarded two if-branches deep, nor when TYPE_CHECKING was imported from typing under an alias.
Closes #7539