Dave Amiana
Jun 10, 2021

--

Hello

Performance is only one of the many things to consider. We also want to express our code as clearly as possible. For a language like Python, it is difficult to read clearly the intent of the developer in expressing their functions. We almost always rely on the context and infer what it meant. This is optional.

The Python interpreter will not impose restrictions even when on annotated functions, but static analyzers like MyPy and Pyright are made to ensure the safety and maintainability of software.

If you worry about improving performance, you can use Cython, Numba, or pybind11 for wrapping your C/C++ backend to Python since Python warmly welcomes C. But this is not the point of Type annotations.

Here's Guido discussing Optional Type Checking in Python:

https://www.youtube.com/watch?v=GiZKuyLKvAA

--

--

Dave Amiana
Dave Amiana

Written by Dave Amiana

Realizing possibilities; Currently working on Matrix library and Networking.

No responses yet