|
|
|
|
|
by infamia
668 days ago
|
|
> What is it, they have nice error messages? I don't expect them to fix code at runtime when type error happens. FastAPI validate both data (serialization) and schemas (used to create APIs and specs). Pydantic can also help with safe casting, not sure if FastApi uses that or not, but it is available > These can't even happen with type checking in the first place. I mean when you're debugging any problem or learning an API. It is nice to have rich types built in, especially while in a REPL, where you can inspect types. > In my experience serializing/deserializing data is pretty much the only place where its useful, and it doesn't have to be built-in on a language level, Pydantic is doing it well enough. Pydantic relies on Python having types built into the language and available at runtime. |
|