| ▲ | shadowgovt 3 hours ago | |
It's true; mypy won't make your Python faster. To get something like that, you'd want to use Common LISP and SBCL; the SBCL compiler can use type assertions to actually throw away code-paths that would verify type expectations at runtime (introducing undefined behavior if you violate the type assertions). It's pretty great, because you can run it in debug mode where it will assert-fail if your static type assertions are violated, or in optimized mode where those checks (and the code to support multiple types in a variable) go away and instead the program just blows up like a C program with a bad cast does. | ||
| ▲ | reactordev an hour ago | parent [-] | |
The point about mypy was it does type checking (static analysis) for your Python code. Not speeding it up. | ||