2 ms·
Having done a py2 to py3 migration and ran into the same issues, these wouldn't of been that big of a deal IF python had static typing from the get go. The sta
by novok 7y ago
Having done a py2 to py3 migration and ran into the same issues, these wouldn't of been that big of a deal IF python had static typing from the get go.
The static compiler would notice all the breaking type changes at compile time and you can systematically fix all of them at once. You wouldn't miss one or two and have to run your unit testing suite to exercise the type system underneath.
I really believe big breaking changes like this in a language causing migration stagnation is a property of dynamically typed languages. With other statically typed languages like swift or rust, it happened quite frequently but wasn't as big of a deal in practice.
- TylerE 7y agoPython with static typing wouldn't be python. It wouldn't even be python-adjacent.
- weberc2 7y agoPython has had static types for years. https://www.python.org/dev/peps/pep-0484/ https://www.python.org/dev/peps/pep-0484/
- TylerE 7y agoYes, because optional annotations are totally the same thing as changing the languages basic functionality.
- weberc2 7y agoOof, that’s quite a take. Static type checkers by definition don’t change the language’s functionality; they merely check the types.
- TylerE 7y agoStatic typing is ceremony. That is anti-Python. If you want Java, write Java. Don't try to make Python Java.
- weberc2 7y agoIt’s literally Python, and if you’re writing sane/correct Python, you should hardly notice (things will work a little better, documentation will be more complete and actually accurate, etc). You can even do many of the same bizarre things that shitty Python programmers do without static typing, such as return differently types data based on the value of an input parameter. Someone passes in the string “asdf” so we’ll return an int, but if they pass “xyzfoo” we return a datetime. Next thing you know you’ve built matplotlib.