Skip to main content

PydanticPluginConfig

A Pydantic mypy plugin config holder.

Attributes

AttributeTypeDescription
init_forbid_extrabool = falseWhether to add a **kwargs at the end of the generated __init__ signature.
init_typedbool = falseWhether to annotate fields in the generated __init__.
warn_required_dynamic_aliasesbool = falseWhether to raise required dynamic aliases error.
debug_dataclass_transformbool = falseWhether to not reset dataclass_transform_spec attribute of ModelMetaclass for testing purposes.

Constructor

Signature

def PydanticPluginConfig(
options: Options
) - > None

Parameters

NameTypeDescription
optionsOptionsThe mypy options object containing the path to the configuration file.

Signature

def PydanticPluginConfig(
options: Options
)

Parameters

NameTypeDescription
optionsOptionsThe mypy options object containing the path to the configuration file to be parsed

Methods


to_data()

@classmethod
def to_data() - > dict[str, Any]

Returns a dict of config names to their values.

Returns

TypeDescription
dict[str, Any]A dictionary mapping configuration attribute names to their current boolean values, suitable for serialization or debugging