Skip to content
masterclass Buddy

Pydantic · Decorator

validate_call

Use @validate_call to check function arguments against their type annotations before the function runs. It can also validate the return value and raises ValidationError for invalid calls.

Last updated

Syntax

validate_call(func: AnyCallableT, /) -> AnyCallableT
validate_call(*, config: ConfigDict | None = None, validate_return: bool = False) -> Callable[[AnyCallableT], AnyCallableT]

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

Subscribe
  • ValidationError
  • ConfigDict
  • Field
  • Annotated
  • raw_function
  • Strict mode
  • TypedDict
  • Unpack

Source: Validation Decorator | Pydantic Docs. Checked 2026-11-03.