This comment from hacker news is exactly my review: I've been using mypy for a while now and I love it! I added mypy type annotations to a bunch of old projects and it found some bugs no one was aware of right away. I love the support I get from mypy within the editor. It works flawlessly on my Linux machine with VSCode. It's quite good at inferring types as well. In most cases it's enough to annotate function parameters and return types. Mypy warns you in case it cannot infer the type for an item. As of today I add mypy to every project that grows a certain size/importance. I think the optional typing approach is great. I usually start prototyping/modelling with few type annotations and gradually add more of them as the code stabilizes and end up with a fully typed solid piece of software. I'm also excited about the benefits mypy/typing brings to the table in the area of compiled Python: Cython is already able to utilize Python type annotations to compile pure Python code: https://cython.readthedocs.io/en/latest/src/tutorial/pure.ht... mypyc is another approach: https://github.com/mypyc/mypyc Nutika wants to utilize Python type annotations as well: https://github.com/Nuitka/Nuitka I guess there are more. I think sooner or later we will have single file binaries compiled from pure Python that run with much improved performance.
Обсуждают сегодня