-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Is there a description of the mypy type checking algorithms? #1994
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
Comments
You're not missing anything -- we just don't detect falling off the end of a function yet. (See #1869 for the issue and #1748 for a complicated work in progress PR). I don't think we have a technical document describing our type checking/inference algorithms, though we'd like to have something like that in the future. FYI, the constraint solving code is used for type variables, but not for the rest of type checking. |
Actually, @JukkaL's PhD thesis probably discusses the type checking approach, but I'm not sure if it's widely available. |
I retitled this issue to reflect the non-duplicate part. |
The PhD thesis is from 2013 and a lot has changed since then. One of the main ideas in the PhD thesis is about having multiple runtime semantics and improving performance, and this has been completely dropped from mypy. Today the thesis is probably more confusing than useful if you want to understand mypy. |
Hi, I am just trying out mypy and have the following code in a file
t.py
:Running
mypy t.py --strict-optional
gives no error or warning. Am I missing something ?Also, are there some technical documentations for mypy, e.g., what type inference and checking algorithms were used ? I saw some code about solving constraints in mypy, but I am more interested in a technical document.
Thanks,
The text was updated successfully, but these errors were encountered: