Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's equivalent to asking if there are benefits of static typing.




Specifically, it's like asking if there are any studies that demonstrate benefits of static typing. Are there?

Not quite, static typing is used at runtime, python type annotations are not

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


tools like dataclasses and pydantic would like to have a word...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: