The types are ignored at runtime; they’re annotations. I guess they could still theoretically have some impact, but it should be negligible.
Compiled mypy is a stated potential goal - but outside the scope of this project itself. Read more here: https://mypy.readthedocs.io/en/stable/faq.html#will-static-t...
Re:Applying Mypy to real-world projects
by hsaliak on Tuesday February 11, 2020 @08:49PM
(#22304994)
There’s an experimental mypyc that can compile typed code to extensions, it’s not complete but it is used in mypy itself if I understand correctly.
More practically, I’ve found that it’s much easier to translate well typed code to cython. It still requires work, and ymmv.
Re:Applying Mypy to real-world projects
by anentropic on Wednesday February 12, 2020 @04:52AM
(#22307456)
eventually there may be... https://github.com/python/mypy/tree/master/mypyc
Re:Applying Mypy to real-world projects
by nimmer on Wednesday February 19, 2020 @11:33AM
(#22367079)
"compiled Mypy with Nim-like speed" is Nim, essentially.
Re:Applying Mypy to real-world projects
by hiccuphippo on Wednesday February 12, 2020 @07:01AM
(#22308111)
I think cython is already using type annotations to compile python code.
Also, does anybody know of any benchmarks of typical programs in Mypy vs cPython?