Static type analysis is still experimental in Python.
Evidence for this is that there ARE multiple type checkers, and they don’t all behave the same way.
It really needs to settle down before there is a single “official” type checker.
Also: Static type checking is optional in Python. There are those of us that are not convinced that static type checking is or should be a Python best practice. An official type checker would be an endorsement not just of that particular approach to type checking, but also the concept itself — I don’t think the community is ready for that.
-CHB
I’m doing some research on Python type annotations recently.
I found that, some dynamic typing related bugs can be effectively avoided in the early stages of code development,
by adding type annotations to Python code and applying some type checking tools (such as MyPy, PyType, Pyright, and Pyre, etc.).
The introduction of type annotations effectively improves the type safety of Python code.
However, different tools discover, classify and report defects in different ways, and there is little overlap in the defects they reported.
In the same code segment, some type checking tools will report defects but some will not.
These may confuse users. Because it is not easy for the user to determine which tools give credible results.
Based on the above, I have the following suggestion:
Is it possible that Python provide a new type checker officially?
Or is it possible that Python choose one of the off-the-shelf type checking tools as the official and recommended one?
Python is my favourite programming language. I sincerely hope that I can help Python become stronger and safer.
I hope this idea can be useful for you.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/CG2IGZSV2Z4YMKLPK5MBWK4K4CDYTAFB/
Code of Conduct: http://python.org/psf/codeofconduct/
--
Christopher Barker, PhD (Chris)
Python Language Consulting
- Teaching
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython