Open madig opened 6 years ago
Here's a nice recent video about it: https://www.youtube.com/watch?v=pMgmKJyWKn8
Gradually introducing types is probably the best option. I'm sure there's a way to only run mypy on code that is being merged in a PR, to remind people to annotate their code.
Python 3 introduced optional type hints: http://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html
It is indirectly possible to use these in Python 2 and have mypy check them by using comments: http://mypy.readthedocs.io/en/latest/python2.html https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code
This would be an additional linting layer.