Comment

Comment by MeetingsBrowser

> teams can always add runtime checks like pydantic to ensure your types match reality.

That's the problem with bugs though, there's always something that could have been done to avoid it =)

Pydantic works great in specific places, like validating user supplied data, but runtime checks as a replacement for static type checkers are not really feasible.

Every caller would need to check that the function is being called correctly (number and position of args, kwarg names, etc) and every callee would need to manually validate that each arg passed matches some expected type.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton