PyPython · Lesson 13 of 14
Type Hints & Modern Python
Python type hints do not make Python a statically typed language — the interpreter still ignores them at runtime. But they let tools like mypy catch bugs before you run the code, and they make your code infinitely more readable.
◆ Note
Install mypy (pip install mypy) and run "mypy yourfile.py" to catch type errors before running. For new projects, use "mypy --strict" to enforce full type coverage. Type hints are especially valuable in larger codebases where you cannot hold the entire program in your head.
Install mypy (pip install mypy) and run "mypy yourfile.py" to catch type errors before running. For new projects, use "mypy --strict" to enforce full type coverage. Type hints are especially valuable in larger codebases where you cannot hold the entire program in your head.