Closed jdidion closed 8 years ago
There is still the question of how to enforce contracts (pre/post conditions) - PEP484 does not deal with that. It looks like there are currently two libraries that handle this in different ways:
Personally, I like the codeviking syntax more, since it is closer to PEP484.
Also pycharm types, which are specified exclusively in docstrings: https://github.com/JetBrains/python-skeletons#types
There has also been a PEP for contracts (using docstrings): https://www.python.org/dev/peps/pep-0316/. It was deferred.
A good intermediate step would be to use PEP484 typing for type hints, and pycontracts for optional runtime contract enforcement, since pycontracts also offers a docstring-based syntax.
Finished adding type hinting. Closing this and opening new issues for generic classes and contracts.
Go through all functions, add missing annotations, and convert all annotations from strings to types as specified in PEP484 and https://docs.python.org/3/library/typing.html