You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[v0.3.3 regression]: F811 incorrectly emitted if a symbol in a stub is re-exported and a symbol by the same name is defined in a different scope
#10509
Closed
AlexWaygood opened this issue
Mar 21, 2024
· 0 comments
· Fixed by #10512
Starting in v0.3.3, Ruff incorrectly emits F811 on this snippet if it's a .pyi file:
fromfooimportBarasBarclassEggs:
Bar: int# F811 Redefinition of unused `Bar` from line 1
This shouldn't be flagged as a redefinition, as the Eggs.Bar variable is being defined in a different scope to the global Bar variable, which is being re-exported from the module. The regression bisects to 4b06669 (by me).
The text was updated successfully, but these errors were encountered:
## Summary
In #10341, we fixed some false
positives in `.pyi` files, but introduced others. This PR effectively
reverts the change in #10341 and fixes it in a slightly different way.
Instead of changing the _bindings_ we generate in the semantic model in
`.pyi` files, we instead change how we _resolve_ them.
Closes#10509.
Starting in v0.3.3, Ruff incorrectly emits F811 on this snippet if it's a
.pyi
file:This shouldn't be flagged as a redefinition, as the
Eggs.Bar
variable is being defined in a different scope to the globalBar
variable, which is being re-exported from the module. The regression bisects to 4b06669 (by me).The text was updated successfully, but these errors were encountered: