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

Fix more crashes in class scoped imports #12199

Merged
merged 6 commits into from
Feb 17, 2022

Conversation

hauntsaninja
Copy link
Collaborator

Fixes #12197 (which contains more context)

This essentially walks back changes in #12023 that apply to
function-like things that are imported in class-scope. We just issue a
(non-blocking) error and mark the type as Any. Inference for variables
still works fine; I'm yet to think of any problems that could cause.

A full fix seems quite difficult, but this is better than both a crash
and a blocking error.

More context in python#12197

This essentially walks back changes in python#12023 that apply to
function-like things that are imported in class-scope. We just issue a
(non-blocking) error and mark the type as Any. Inference for variables
still works fine; I'm yet to think of any problems that could cause.

A full fix seems quite difficult, but this is better than both a crash
and a blocking error.
@hauntsaninja
Copy link
Collaborator Author

Thanks, added both!

@hauntsaninja
Copy link
Collaborator Author

Oh should also note I tested with from z import * where z is various typeshed modules, and I didn't get any more crashes.

@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

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

Successfully merging this pull request may close these issues.

More crashes in class scoped imports
2 participants