MCPcopy
hub / github.com/fastapi/fastapi / is_pydantic_v1_model_instance

Function is_pydantic_v1_model_instance

fastapi/_compat/shared.py:178–187  ·  view source on GitHub ↗
(obj: Any)

Source from the content-addressed store, hash-verified

176
177
178def is_pydantic_v1_model_instance(obj: Any) -> bool:
179 # TODO: remove this function once the required version of Pydantic fully
180 # removes pydantic.v1
181 try:
182 with warnings.catch_warnings():
183 warnings.simplefilter("ignore", UserWarning)
184 from pydantic import v1
185 except ImportError: # pragma: no cover
186 return False
187 return isinstance(obj, v1.BaseModel)
188
189
190def is_pydantic_v1_model_class(cls: Any) -> bool:

Callers 1

jsonable_encoderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…