|
|
Subscribe / Log in / New account

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

Personally, I really like Python as an expressive scripting language, and the single biggest thing that makes me want to use it less and other languages more is the lack of static typing and static error handling.

"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.


to post comments

Opposition to Python type hints

Posted May 7, 2015 17:08 UTC (Thu) by HelloWorld (guest, #56129) [Link]

> "dynamic" is not a feature; in every possible way it's a bug.
Amen to that.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds