4 ms·
So PEP 484? You can write out whatever and then add annotations (at least to the API).
by nearmuse 9y ago
So PEP 484? You can write out whatever and then add annotations (at least to the API).
- zero_iq 9y agoAlso Cython: start with pure Python and add types and other annotations to get the performance gains of static compilation (to C Python extension).
- pleasecalllater 9y agoSo you spend time writing the things, which then are totally ignored by the compiler/interpreter. Seems like a waste of time, except for documentation purpose.
- dec0dedab0de 9y agoDocumentation is never a waste of time. Especially if your IDE is aware of it, and pointing out errors for you.
- nearmuse 9y agoThose are actually enforceable by IDE or interpreter/compiler if implemented. Even if this wasn't the case, it is better than some arbitrary variable naming convention or comments format.
- tedmiston 9y agoYou can check them at runtime with mypy. http://mypy-lang.org/index.html http://mypy-lang.org/index.html