Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JukkaL opened this issue Sep 21, 2016 · 3 comments
Closed
Assignees

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Sep 21, 2016

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.

@gvanrossum
Copy link
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.

@gvanrossum
Copy link
Member

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

@gvanrossum gvanrossum reopened this Oct 13, 2016
@gvanrossum gvanrossum added this to the 0.4.x milestone Oct 13, 2016
@gvanrossum
Copy link
Member

Fixed by #2167.

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

No branches or pull requests

2 participants