Skip to main content

from_attributes_callback

Raise an error if from_attributes is not enabled.

def from_attributes_callback(
ctx: MethodContext
) - > Type

Raise an error if from_attributes is not enabled.

Parameters

NameTypeDescription
ctxMethodContextThe Mypy plugin context for the method call, providing access to the underlying model type and the API for reporting errors.

Returns

TypeDescription
TypeThe default return type provided by the method context, typically used to maintain type consistency after validation checks.