- What do we actually mean when we say a Python library is type-safe? eg, from the first page of pydantic-ai’s doc:
Fully Type-safe: Designed to give your IDE or AI coding agent as much context as possible for auto-completion and type checking, moving entire classes of errors from runtime to write-time for a bit of that Rust “if it compiles, it works” feel.
Does it simply means it pass pyright in strict level? What if I just slap a bunch of
cast?Is there a standard / criterion on how good you are doing gradual typing?
Is it possible that in some circumstances your gradual typing is doing more harm than good?
I feel like sometimes when I use
cast, I really want to give an explicit reaon as documentation for why this value has this type so thatcastcan be trusted.