MCPcopy
hub / github.com/pydantic/pydantic / __init__

Method __init__

pydantic/_internal/_validate_call.py:66–90  ·  view source on GitHub ↗
(
        self,
        function: ValidateCallSupportedTypes,
        config: ConfigDict | None,
        validate_return: bool,
        parent_namespace: MappingNamespace | None,
    )

Source from the content-addressed store, hash-verified

64 )
65
66 def __init__(
67 self,
68 function: ValidateCallSupportedTypes,
69 config: ConfigDict | None,
70 validate_return: bool,
71 parent_namespace: MappingNamespace | None,
72 ) -> None:
73 self.function = function
74 self.validate_return = validate_return
75 if isinstance(function, partial):
76 self.schema_type = function.func
77 self.module = function.func.__module__
78 else:
79 self.schema_type = function
80 self.module = function.__module__
81 self.qualname = extract_function_qualname(function)
82
83 self.ns_resolver = NsResolver(
84 namespaces_tuple=ns_for_function(self.schema_type, parent_namespace=parent_namespace)
85 )
86 self.config_wrapper = ConfigWrapper(config)
87 if not self.config_wrapper.defer_build:
88 self._create_validators()
89 else:
90 self.__pydantic_complete__ = False
91
92 def _create_validators(self) -> None:
93 gen_schema = GenerateSchema(self.config_wrapper, self.ns_resolver)

Callers

nothing calls this directly

Calls 5

_create_validatorsMethod · 0.95
NsResolverClass · 0.85
ns_for_functionFunction · 0.85
ConfigWrapperClass · 0.85

Tested by

no test coverage detected