Hacker News new | ask | show | jobs
by dragonwriter 2191 days ago
> I believe that some recent Python version has added (optional) type annotation support.

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.

1 comments

> Annotation support was added in 3.0

However, support for type annotations, specifically, wasn’t added until Python 3.5 (via PEP 484).

What PEP 484 was standardize the use of annotations as type annotations and provide ancillary out-of-the-box support for type hinting via annotations, particularly the typing module.

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.