Project

General

Profile

Idea #23144

Updated by Marco Mambelli over 1 year ago

Python type annotation is available in Python3
It has been ported as a comment in Python 2.7
We should start adopting within the project, at least in function declarations

Definitely in branch_v3_7 but also in master, using comments notation for python 2.7:
https://www.python.org/dev/peps/pep-0484/
https://docs.python.org/3/library/typing.html
https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html

Some advantages:
* Static analysis (more robust code)
*Self documentation
* Will help also w/ code completion: https://medium.com/@shamir.stav_83310/the-other-great-benefit-of-python-type-annotations-896c7d077c6b

Back