KEMBAR78
Fix more crashes in class scoped imports by hauntsaninja · Pull Request #12199 · python/mypy · GitHub
Skip to content

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