Annotation support was added in 3.0, which isn't really a recent version of Python, having been released about 11.5 years ago.
Also, mypy, while it can use Python 3.x annotations, also supports static checking of Python 2.x code using type comments.
However, support for type annotations, specifically, wasn’t added until Python 3.5 (via PEP 484).
Mypy was actually using python 3.x annotation for type annotations before PEP 484 standardized them brought the stdlib typing module, but with PEP 484 there was a common, language-defined standard baseline for mypy and other efforts.
Running a type checker in Python is a way to avoid runtime type errors, just like in compiled languages, but without a performance benefit.
this can be made prohibited by MyPy's --strict flag [1], and enforced with a mypy git pre-commit hook locally, and with a MyPy CI job.
[1] https://mypy.readthedocs.io/en/stable/command_line.html#cmdo...
They can (as in - there's API for that, the rest is up to a community effort) improve performance of a final program, if type-annotated code is passed through Cython with ``annotation_typing=True`` flag:
http://docs.cython.org/en/latest/src/tutorial/pure.html#stat...
https://github.com/cython/cython/issues/1672#issuecomment-29...