Hacker News new | ask | show | jobs
by stefano 2079 days ago
It was a problem only because somehow they decided that type annotations should evaluate to something meaningful at runtime, instead of being a compile-time only construct like in every other language.
2 comments

"Somehow they decided" is rooted in the desire to make typing optional, and absolutely not a requirement.
Wouldn't compiler selective enforcement achieve the same goal? It seems to me the difference is that other programs can be implemented to do the typechecking (eg mypy) rather than the compiler doing so itself
It lets you do things like `functools.singledispatchmethod`.
Any language with reflections needs to evaluate types as something meaningful at runtime.
The runtime mirror doesn't have to have the same name as the compile-time type. Look at Java where you have to do weird things with class objects to do reflective access.