model_copy#
- BackDrillStubLength.model_copy(*, update: Mapping[str, Any] | None = None, deep: bool = False) Self#
- !!! abstract “Usage Documentation”
[model_copy](../concepts/models.md#model-copy)
Returns a copy of the model.
- !!! note
The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).
- Args:
- update: A mapping of values to update the copied model. Updates are not
applied recursively, and no validation is performed on updated values. Only the known fields are updated (if unknown keys are being passed and the model has [extra][pydantic.ConfigDict.extra] set to ‘allow’, they are added as extra data).
deep: Whether a [deep copy][copy.deepcopy] of the model should be performed.
- Returns:
New model instance.