help wantedrule
Description
I'd like to request the deprecated-import rule be split in two. Currently UP035 flags two different kinds of deprecations:
- Names that have been moved, with a deprecated alias. Examples:
collections.*=>collections.abc.*{pipes => shlex}.quote
- Types that are deprecated, considered equivalent by type checkers, but are different runtime values.
- This is everything in the
typing,typing_extensionsandmypy_extensionsmodules.
- This is everything in the
For the former group, fixing them is significantly safer, since the only visible side-effects would be that a module wasn't imported (in the case of pipes), and a lack of a DeprecationWarning. It'd be rare for code to depend on those side-effects. The latter group can potentially be an unsafe change if something tries to observe the types directly at runtime though.
Ultimately I'd like to be able to autofix the moved names, whilst being able to separately flag (with a suggested fix) the typing changes that would be observable at runtime.