Skip to main content

AnnotatedParamWithDefaultValueError

This class represents an exception raised when a default value is incorrectly defined within an Annotated type hint for a parameter. It identifies the specific argument and parameter type involved, instructing the user to set the default value using standard assignment syntax instead.

Attributes

AttributeTypeDescription
argument_namestrThe name of the function argument that incorrectly specified a default value within an Annotated type hint.
param_typetype[[ParameterInfo](../models/parameterinfo.md?sid=typer_models_parameterinfo)]The specific ParameterInfo subclass type associated with the argument that triggered the validation error.

Constructor

Signature

def AnnotatedParamWithDefaultValueError(
argument_name: str,
param_type: type[[ParameterInfo](../models/parameterinfo.md?sid=typer_models_parameterinfo)]
)

Parameters

NameTypeDescription
argument_namestrThe name of the argument that has an invalid default value in Annotated.
param_typetype[[ParameterInfo](../models/parameterinfo.md?sid=typer_models_parameterinfo)]The type of the parameter associated with the error.

Signature

def AnnotatedParamWithDefaultValueError(
argument_name: str,
param_type: type[[ParameterInfo](../models/parameterinfo.md?sid=typer_models_parameterinfo)]
) - > null

Parameters

NameTypeDescription
argument_namestrThe name of the function argument where the invalid default value was detected.
param_typetype[[ParameterInfo](../models/parameterinfo.md?sid=typer_models_parameterinfo)]The specific type of parameter metadata class being used in the Annotated hint.