Skip to content

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

Closed

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.

Activity

  1. self-assigned this
    on Sep 21, 2016
  2. gvanrossum commented on Oct 12, 2016

    @gvanrossum
    Member

    I tried this (#2167) and it didn't work very well. We may try again in the future but for now I think it's a dead end, so I'm closing this.

  3. gvanrossum commented on Oct 13, 2016

    @gvanrossum
    Member

    Sorry, reopening, we need both this and the cross-module deferred processing of functions I proposed in #481 (comment).

  4. added this to the milestone on Oct 13, 2016
  5. gvanrossum commented on Nov 1, 2016

    @gvanrossum
    Member

    Fixed by #2167.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions