Opposition to Python type hints
Opposition to Python type hints
Posted May 7, 2015 3:19 UTC (Thu) by josh (subscriber, #17465)Parent article: Opposition to Python type hints
"dynamic" is not a feature; in every possible way it's a bug. That doesn't mean you can't have a type like "undefined", saying "I don't know what this is yet, let me compile my code with stubs and just raise an exception if I call them". But I'm tired of finding errors at runtime that many other languages would call out at compile time.
Real-world example from the other day: refactoring common code into a method, attempting to change all occurrences of a particular variable name into a more general name, and missing one in the middle of a large expression. Most languages would catch that at compile time; Python didn't catch it until the method was called. When your project's overall compile-debug cycle is a few minutes, problems like that add up.
Posted May 7, 2015 17:08 UTC (Thu)
by HelloWorld (guest, #56129)
[Link]
Opposition to Python type hints
Amen to that.
