Pydantic · Function
constr
Pydantic strict types prevent coercion from compatible input types. Use them when validation must receive the declared type, such as requiring an integer instead of accepting a float that could be converted.
Last updated
Syntax
StrictBool
StrictBytes
StrictFloat
StrictInt
StrictStr
FiniteFloatIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
StrictBoolStrictBytesStrictFloatStrictIntStrictStrFiniteFloatconbytes()confloat()