7 ms·
Not quite, static typing is used at runtime, python type annotations are not
by sails01 9mo ago
Not quite, static typing is used at runtime, python type annotations are not
- amethyst 9mo agotools like dataclasses and pydantic would like to have a word...
- dragonwriter 9mo ago> Not quite, static typing is used at runtime, python type annotations are not No, static typing is usually used AOT (most frequently at compile time), not usually at runtime (types may or may not exist at runtime; they don't in Haskell, for instance.) Python type checking is also AOT, but (unlike where it is inextricably tied to compilation because types are not only checked but used for code generation) it is optional to actually do that step. Python type annotations exist and are sometimes used at runtime, but not usually at that point for type checking in the usual sense.
- tome 9mo ago> > Not quite, static typing is used at runtime, python type annotations are not > No, static typing is usually used AOT (most frequently at compile time), not usually at runtime (types may or may not exist at runtime; they don't in Haskell, for instance.) In fact, Haskell then allows you to add back in runtime types using Typeable! https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-Typeable.html https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-...
- wiseowise 9mo ago> static typing is used at runtime Educate yourself before making such claims.