Skip to content
masterclass Buddy

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
FiniteFloat

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • StrictBool
  • StrictBytes
  • StrictFloat
  • StrictInt
  • StrictStr
  • FiniteFloat
  • conbytes()
  • confloat()

Source: Types/strict types | Pydantic Docs. Checked 2026-11-03.