MCPcopy
hub / github.com/pydantic/pydantic / __str__

Method __str__

pydantic/v1/error_wrappers.py:70–76  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

68 return json.dumps(self.errors(), indent=indent, default=pydantic_encoder)
69
70 def __str__(self) -> str:
71 errors = self.errors()
72 no_errors = len(errors)
73 return (
74 f'{no_errors} validation error{"" if no_errors == 1 else "s"} for {self.model.__name__}\n'
75 f'{display_errors(errors)}'
76 )
77
78 def __repr_args__(self) -> 'ReprArgs':
79 return [('model', self.model.__name__), ('errors', self.errors())]

Callers

nothing calls this directly

Calls 2

errorsMethod · 0.95
display_errorsFunction · 0.85

Tested by

no test coverage detected