Hacker News new | past | comments | ask | show | jobs | submit login

> The Python folks knew that multiple incompatible systems would arise from a grammar spec without a behavior spec.

Python typecheckers predate in-language annotations and drove the spec, not vice versa.




Function annotations were added as part of Python 3.0, with PEP 3107, proposed in 2006 [0]. The first public mypy commit was in 2012 [1], and originally it was using C++-style syntax (`list<Token> lex(str s):`). The `typing` module and the official use of function annotation for type hints came in 2014 with PEP 484 [2], inspired by mypy. The first pyright commit was in 2019 (with a lot of code in the third commit [3], possibly moved from the VSCode extension).

[0] https://peps.python.org/pep-3107/

[1] https://github.com/python/mypy/commit/6f0826a9c169c4f05bb893...

[2] https://peps.python.org/pep-0484/

[3] https://github.com/microsoft/pyright/commit/1d91744b1f268fd0...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: