Open fzimmermann89 opened 2 hours ago
That's a neat idea although it'll require Ruff to know whether typing_extensions
is a dependency of the project.
I'll merge this into https://github.com/astral-sh/ruff/issues/2501 which is a more general request to add "backporting" rules.
@MichaReiser But https://github.com/astral-sh/ruff/issues/2501 is also due to the much larger scope of transforming syntax a lot more complex and thus stuck...
We can keep it open but there remains the question where the rule should belong to. Naturally, it would fit into the pydowngrade category but we could consider adding it to Ruff.
An automatic fix would be great if symbols are imported from
typing
that are not available at the lowest required python version but are available intyping_extensions
, iftyping_extensions
is a dependency. This would fix the opposite issues of #7285 UP035.