Returns a shallow copy of the model.
(self)
| 96 | _object_setattr(self, '__dict__', state['__dict__']) |
| 97 | |
| 98 | def __copy__(self) -> Self: |
| 99 | """Returns a shallow copy of the model.""" |
| 100 | cls = type(self) |
| 101 | m = cls.__new__(cls) |
| 102 | new_dict = copy(self.__dict__) |
| 103 | new_dict['root'] = copy(self.__dict__['root']) |
| 104 | _object_setattr(m, '__dict__', new_dict) |
| 105 | _object_setattr(m, '__pydantic_fields_set__', copy(self.__pydantic_fields_set__)) |
| 106 | return m |
| 107 | |
| 108 | def __deepcopy__(self, memo: dict[int, Any] | None = None) -> Self: |
| 109 | """Returns a deep copy of the model.""" |