4 ms·
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 onl
by stefano 6y 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.
- smitty1e 6y ago"Somehow they decided" is rooted in the desire to make typing optional, and absolutely not a requirement.
- setr 6y agoWouldn'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
- ben-schaaf 6y agoIt lets you do things like `functools.singledispatchmethod`.
- m45t3r 6y agoAny language with reflections needs to evaluate types as something meaningful at runtime.
- lmm 6y agoThe 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.