Skip to content

Deprioritize imports within a if TYPE_CHECKING: when processing import cycles #2166

Closed
@JukkaL

Description

@JukkaL

If an import is ignored at runtime (due to being in an if TYPE_CHECKING: or if MYPY: block), it should always be considered to be of the lowest priority when sorting import cycles. This is important, in particular, since the imports could well be of form from m import ..., which are given the highest priority right now.

There is more discussion in #481.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions