-
Notifications
You must be signed in to change notification settings - Fork 903
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
UP035
false positive on typing_extensions.dataclass_transform
on python 3.11
#5112
Comments
Ah interesting, okay, thank you. |
Looks like ruff will also do this if you run - from typing_extensions import SupportsIndex
+ from typing import SupportsIndex
isinstance(42, SupportsIndex) But the |
@AlexWaygood - Would you suggest not rewriting |
Yes -- and FWIW, pyupgrade recently made that change in asottile/pyupgrade@5059713, which is included in pyupgrade v3.7 (following my PR asottile/reorder-python-imports#341 to the reorder-python-imports project, which pyupgrade uses). |
Thanks! |
...which, looking at it again, it seems I forgot to include Ruff can show its value-add here by not making that mistake :D |
Hahah oh no 😂 |
## Summary Remove recommendations to replace `typing_extensions.dataclass_transform` and `typing_extensions.SupportsIndex` with their `typing` library counterparts. Closes #5112. ## Test Plan Added extra checks to the test fixture. `cargo test`
typing_extensions.dataclass_transform
has thefrozen_default
parameter which won't be intyping
until python 3.12.from
typing_extensions
:The text was updated successfully, but these errors were encountered: