Skip to content
masterclass Buddy

Pydantic · Class

Strict

Pydantic strict mode reduces type coercion during validation. It can apply to one call, one field, or a whole model.

Last updated

Syntax

Annotated[T, Strict()]
Field(strict=True)
ConfigDict(strict=True)
validate_python(value, strict=True)

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

Subscribe
  • StrictBool
  • StrictBytes
  • StrictFloat
  • StrictInt
  • StrictStr
  • Field
  • ConfigDict
  • TypeAdapter

Source: Strict Mode | Pydantic Docs. Checked 2026-11-03.