3 ms·
mypy is a great project and I agree that basically every project at scale should use it. However, I think you're wrong about the strength of the Python type sys
by aeturnum 5y ago
mypy is a great project and I agree that basically every project at scale should use it. However, I think you're wrong about the strength of the Python type system and what a good type system can "get" you. I think mypy both does an amazing job at static checking and that more powerful type systems go far beyond static checks and into changing how you structure and write code. The newly introduced "structural pattern matching" they just introduced[1] is an example of the kind of feature that could be usefully expanded by making type a first-class part of the Python runtime.
Again - the dynamism of Python means teams can write amazing extensions to Python (like mypy), but that isn't a replacement for the core team having a plan for how they think typing information should be used at runtime. Their current answer seems to be "nothing," which disappoints me.
[1] https://www.python.org/dev/peps/pep-0622/ https://www.python.org/dev/peps/pep-0622/