Skip to content
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

Iterate over lambdas in deferred type annotations #9175

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Conversation

charliermarsh
Copy link
Member

Closes #9159.

@charliermarsh charliermarsh added the bug Something isn't working label Dec 18, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) December 18, 2023 04:49
@charliermarsh charliermarsh merged commit 2643f74 into main Dec 18, 2023
16 checks passed
@charliermarsh charliermarsh deleted the charlie/defer branch December 18, 2023 04:51
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

charliermarsh added a commit that referenced this pull request Jan 16, 2024
## Summary

This is effectively the same problem as
#9175. And this just papers over
it again, though I'm gonna try a more holistic fix in a follow-up PR.
The _real_ fix here is that we need to continue to visit deferred items
until they're exhausted since, e.g., we still get this case wrong
(flagging `re` as unused):

```python
import re

cast(lambda: re.match, 1)
```

Closes #9534.
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.

PEP 695 type annotations with lambdas produce false F401
2 participants