MCPcopy
hub / github.com/pydantic/pydantic / dict

Method dict

pydantic/main.py:1323–1345  ·  pydantic/main.py::BaseModel.dict
(  # noqa: D102
        self,
        *,
        include: IncEx | None = None,
        exclude: IncEx | None = None,
        by_alias: bool = False,
        exclude_unset: bool = False,
        exclude_defaults: bool = False,
        exclude_none: bool = False,
    )

Source from the content-addressed store, hash-verified

1321
1322 @typing_extensions.deprecated(&class="cm">#x27;The `dict` method is deprecated; use `model_dump` instead.', category=None)
1323 def dict( class="cm"># noqa: D102
1324 self,
1325 *,
1326 include: IncEx | None = None,
1327 exclude: IncEx | None = None,
1328 by_alias: bool = False,
1329 exclude_unset: bool = False,
1330 exclude_defaults: bool = False,
1331 exclude_none: bool = False,
1332 ) -> Dict[str, Any]: class="cm"># noqa UP006
1333 warnings.warn(
1334 &class="cm">#x27;The `dict` method is deprecated; use `model_dump` instead.',
1335 category=PydanticDeprecatedSince20,
1336 stacklevel=2,
1337 )
1338 return self.model_dump(
1339 include=include,
1340 exclude=exclude,
1341 by_alias=by_alias,
1342 exclude_unset=exclude_unset,
1343 exclude_defaults=exclude_defaults,
1344 exclude_none=exclude_none,
1345 )
1346
1347 @typing_extensions.deprecated(&class="cm">#x27;The `json` method is deprecated; use `model_dump_json` instead.', category=None)
1348 def json( class="cm"># noqa: D102

Calls 1

model_dumpMethod · 0.95