3 ms·
I really like type hints in Python. It allowed me to catch several errors before running code. But it isn't always the most straight forward process. However,
by k1next 3y ago
I really like type hints in Python. It allowed me to catch several errors before running code. But it isn't always the most straight forward process.
However, my most frequently occurring thought is: I'm doing all the typing, I wish I could get some performance benefits out of it.
- kobzol 3y agoGood point! Guido mentioned that maybe in the future, the new "mini-JIT" in CPython might be able to leverage the type hints. I also want to have this as a thesis topic for my students, to try it out.
- davidatbu 3y agoThat would be interesting! You might already be aware. But there's mypyc[0], which is an AOT compiler for Python code with type hints (that, IIRC, mypy uses to compile itself into a native extension). Wanted to give you a head-start on the lit-review for your students I guess :) [0] https://github.com/mypyc/mypyc https://github.com/mypyc/mypyc