3 ms·
> They are not checked at runtime at all. Type declarations are only used for static analyzing tools and not by the runtime. This is the common usecase, but ty
by flakes 2y ago
> They are not checked at runtime at all. Type declarations are only used for static analyzing tools and not by the runtime.
This is the common usecase, but types certainly are used at runtime by many libraries. Frameworks like FastAPI use the type annotations to declare dependency injection which is resolved during application startup. In other cases like Pydantic, they are used to determine marshalling/unmarshalling strategies.