Re:Writing Python like it's Rust
by mejutoco on Sunday May 21, 2023 @05:52PM
(#36025012)
For this example pydantic would be overkill, but you can use with it class definitions that follow standard python class hints, with additional utilities like YourClass.parse_obj(d) that parse a dict and throw a validation error if it does not match, with mostly standard type annotations.
It can also be used to generate openapi swagger files from the types and things like that.
It can also be used to generate openapi swagger files from the types and things like that.