3 ms·
The information from annotations is exposed to the runtime, but nothing in the runtime treats them as types or performs any type checking. The feature was intro
by ubernostrum 9y ago
The information from annotations is exposed to the runtime, but nothing in the runtime treats them as types or performs any type checking. The feature was introduced as a generic way to annotate functions, without being constrained to a single use case (type checking), and all the tools which actually do type-checking based on annotations are third-party.
- randyrand 9y agoC++ also does do any type checking at runtime. Compile time checking is all that really matters.
- ubernostrum 9y agoThe CPython implementation does have a "compile" step (to produce bytecode, which is what actually gets executed, by a simple stack-based virtual machine), and does not do any type checking in that step no matter how many annotations you give it.