PydanticPluginConfig
A Pydantic mypy plugin config holder.
Attributes
| Attribute | Type | Description |
|---|---|---|
| init_forbid_extra | bool = false | Whether to add a **kwargs at the end of the generated __init__ signature. |
| init_typed | bool = false | Whether to annotate fields in the generated __init__. |
| warn_required_dynamic_aliases | bool = false | Whether to raise required dynamic aliases error. |
| debug_dataclass_transform | bool = false | Whether to not reset dataclass_transform_spec attribute of ModelMetaclass for testing purposes. |
Constructor
Signature
def PydanticPluginConfig(
options: Options
) - > None
Parameters
| Name | Type | Description |
|---|---|---|
| options | Options | The mypy options object containing the path to the configuration file. |
Signature
def PydanticPluginConfig(
options: Options
)
Parameters
| Name | Type | Description |
|---|---|---|
| options | Options | The 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
| Type | Description |
|---|---|
dict[str, Any] | A dictionary mapping configuration attribute names to their current boolean values, suitable for serialization or debugging |