You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Organize Imports: remaining gaps in string annotation handling (follow-up to #969) #993
Follow-up to #369 / #969, which made Organize Imports keep imports
referenced only by quoted type annotations. These remaining gaps
were found in review and deliberately left out of #969:
PEP 695 type aliases lose the import._visit_annotation
is never reached from the TypeAlias node, so in
the string is treated as a forward reference and the unused
import is wrongly kept. Preserve imports referenced by quoted type annotations #969 pins this with an expectedFailure test
(test_imports_not_used_by_aliased_literal_annotation_values).
f-string annotations are matched too loosely. For value: f"wibble {mod1}" the literal text fragments are parsed
as expressions as well, so an import named wibble would be
kept. This errs on the safe side (master removed imports here
instead) and is low priority.
Activity
Document async def scoping and pin aliased Literal limitation