Skip to content

Don't treat annotations as redefinitions in .pyi files#10512

Merged
charliermarsh merged 1 commit intomainfrom
charlie/F811
Mar 21, 2024
Merged

Don't treat annotations as redefinitions in .pyi files#10512
charliermarsh merged 1 commit intomainfrom
charlie/F811

Conversation

@charliermarsh
Copy link
Member

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.

@charliermarsh charliermarsh added the bug Something isn't working label Mar 21, 2024
@charliermarsh charliermarsh requested review from AlexWaygood and MichaReiser and removed request for MichaReiser March 21, 2024 16:07
@AlexWaygood
Copy link
Member

Nice, this looks good! Let me just run this branch on typeshed quickly.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that it fixes the regressions for typeshed, and doesn't introduce any new ones (with our current config, at least)!

@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh charliermarsh merged commit caa1450 into main Mar 21, 2024
@charliermarsh charliermarsh deleted the charlie/F811 branch March 21, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[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

2 participants