asottile / pyupgrade

A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
MIT License
3.62k stars 183 forks source link

pep585 import aliases #983

Closed stephenfin closed 1 month ago

stephenfin commented 1 month ago

Track aliases so that pep585 rewriting works with e.g.

import typing
x: ty.List[str] = []
asottile commented 1 month ago

aliases present all sorts of problems and so they are intentionally not supported.

stephenfin commented 1 month ago

they are intentionally not supported.

I did my due diligence and couldn't find anything in the code or existing issues to suggest this. Additionally, I see support for aliased objects in multiple plugins. If there's a serious issue I've missed here than a little more context would have been a good learning experience for both me and anyone else that stumbles upon this issue. But fine :shrug: As always, been a pleasure interacting with you, Anthony 🙄

asottile commented 1 month ago

the only plug-in with support is the imports one because the result is unambiguous