MCPcopy
hub / github.com/pydantic/pydantic / ConfigWrapper

Class ConfigWrapper

pydantic/_internal/_config.py:29–241  ·  view source on GitHub ↗

Internal wrapper for Config which exposes ConfigDict items as attributes.

Source from the content-addressed store, hash-verified

27
28
29class ConfigWrapper:
30 """Internal wrapper for Config which exposes ConfigDict items as attributes."""
31
32 __slots__ = ('config_dict',)
33
34 config_dict: ConfigDict
35
36 # all annotations are copied directly from ConfigDict, and should be kept up to date, a test will fail if they
37 # stop matching
38 title: str | None
39 str_to_lower: bool
40 str_to_upper: bool
41 str_strip_whitespace: bool
42 str_min_length: int
43 str_max_length: int | None
44 extra: ExtraValues | None
45 frozen: bool
46 populate_by_name: bool
47 use_enum_values: bool
48 validate_assignment: bool
49 arbitrary_types_allowed: bool
50 from_attributes: bool
51 # whether to use the actual key provided in the data (e.g. alias or first alias for "field required" errors) instead of field_names
52 # to construct error `loc`s, default `True`
53 loc_by_alias: bool
54 alias_generator: Callable[[str], str] | AliasGenerator | None
55 model_title_generator: Callable[[type], str] | None
56 field_title_generator: Callable[[str, FieldInfo | ComputedFieldInfo], str] | None
57 ignored_types: tuple[type, ...]
58 allow_inf_nan: bool
59 json_schema_extra: JsonDict | JsonSchemaExtraCallable | None
60 json_encoders: dict[type[object], JsonEncoder] | None
61
62 # new in V2
63 strict: bool
64 # whether instances of models and dataclasses (including subclass instances) should re-validate, default 'never'
65 revalidate_instances: Literal['always', 'never', 'subclass-instances']
66 ser_json_timedelta: Literal['iso8601', 'float']
67 ser_json_temporal: Literal['iso8601', 'seconds', 'milliseconds']
68 val_temporal_unit: Literal['seconds', 'milliseconds', 'infer']
69 ser_json_bytes: Literal['utf8', 'base64', 'hex']
70 val_json_bytes: Literal['utf8', 'base64', 'hex']
71 ser_json_inf_nan: Literal['null', 'constants', 'strings']
72 # whether to validate default values during validation, default False
73 validate_default: bool
74 validate_return: bool
75 protected_namespaces: tuple[str | Pattern[str], ...]
76 hide_input_in_errors: bool
77 defer_build: bool
78 plugin_settings: dict[str, object] | None
79 schema_generator: type[GenerateSchema] | None
80 json_schema_serialization_defaults_required: bool
81 json_schema_mode_override: Literal['validation', 'serialization', None]
82 coerce_numbers_to_str: bool
83 regex_engine: Literal['rust-regex', 'python-re']
84 validation_error_cause: bool
85 use_attribute_docstrings: bool
86 cache_strings: bool | Literal['all', 'keys', 'none']

Callers 8

test_config_wrapper_reprFunction · 0.90
_model_schemaMethod · 0.85
pushMethod · 0.85
__init__Method · 0.85

Calls

no outgoing calls