Skip to main content

ParamMeta

This class serves as a metadata container for function parameters, storing their name, default value, and type annotation. It utilizes standard inspection constants to represent empty values and provides a structured way to manage parameter definitions.

Attributes

AttributeTypeDescription
emptyAny = inspect.Parameter.emptyA sentinel value used to represent the absence of a default value or type annotation, sourced from inspect.Parameter.empty.
namestrThe identifier string representing the name of the parameter.
defaultAny = inspect.Parameter.emptyThe default value assigned to the parameter if no argument is provided during a call.
annotationAny = inspect.Parameter.emptyThe type hint or metadata associated with the parameter to define its expected data type.

Constructor

Signature

def ParamMeta(
name: str,
default: Any = inspect.Parameter.empty,
annotation: Any = inspect.Parameter.empty
) - > None

Parameters

NameTypeDescription
namestrThe name of the parameter.
defaultAny = inspect.Parameter.emptyThe default value of the parameter, if any.
annotationAny = inspect.Parameter.emptyThe type annotation of the parameter, if any.

Signature

def ParamMeta(
name: str,
default: Any = inspect.Parameter.empty,
annotation: Any = inspect.Parameter.empty
) - > None

Parameters

NameTypeDescription
namestrThe identifier of the parameter as defined in the function signature.
defaultAny = inspect.Parameter.emptyThe default value assigned to the parameter if no argument is provided by the caller.
annotationAny = inspect.Parameter.emptyThe type hint or metadata annotation associated with the parameter.