4 ms·
Python’s new type hinting seems to solve most problems pragmatically, are there issues you have with it?
by netfl0 7y ago
Python’s new type hinting seems to solve most problems pragmatically, are there issues you have with it?
- sabujp 7y agopytype is nasty when you're trying to set a return type for a function that was previously returning different types (e.g. let's say different protos).
- ShinTakuya 7y agoHow so? You could use the Union type temporarily if needed.
- BerislavLopac 7y agoMy main problem with it is that it can add a lot of extra syntax which -- while immensely useful for static checking -- is never executed in production. PEP 484 includes support for stub .pyi files, which contain the typing, but IDEs still don't take advantage of that.