2 ms·
For Python 2 you could greetings.__annotations__ = {'name': str, 'return': str} Same exact effect. The syntax isn't the magic sauce, the type checker is.
by sitkack 11y ago
For Python 2 you could
greetings.__annotations__ = {'name': str, 'return': str}
Same exact effect.
The syntax isn't the magic sauce, the type checker is.
http://www.mypy-lang.org/ http://www.mypy-lang.org/
https://github.com/google/pytype https://github.com/google/pytype