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

Improve handling of some string forward references: #652

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JelleZijlstra
Copy link
Contributor

Discovered that similar errors were treated differently with list[]
and List[]. I think we may not need the suppression of undefined names
here any more thanks to some other changes.

Discovered that similar errors were treated differently with list[]
and List[]. I think we may not need the suppression of undefined names
here any more thanks to some other changes.
@JelleZijlstra
Copy link
Contributor Author

Internally this leads to a bunch of false positives with type aliases imported from other files, but also some true positives where we're doing e.g. Optional["NoSuchType"]. Probably the better solution is to change how we check type annotations: instead of evaluating them to a value and then running that through type_from_value(), we should visit the AST and evaluate strings at that point. That will also allow us to point the error more precisely.

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.

1 participant