Skip to content

Type Inference on Imported Symbols #1986

Answered by erictraut
elbaro asked this question in Q&A
Discussion options

You must be logged in to vote

Are you asking simply because you're curious? Or do you see a problem here?

The binder doesn't do any type evaluation. It simply discovers symbols and associates them with scopes. It also builds the code flow graph that is used later during type evaluation.

The typeEvaluator is the component that determines the type of a symbol or an expression. It does this on demand, and it can do it in any order. It's smart enough to evaluate dependent symbol types even if that requires jumping around between files.

The checker simply visits every statement in a file and invokes the type evaluator on every statement.

In the example above, pyright is asked to analyze only one file: test1.py. That means …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@elbaro
Comment options

Answer selected by elbaro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants