MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _clone

Method _clone

lib/sqlalchemy/sql/annotation.py:355–364  ·  view source on GitHub ↗
(self, **kw: Any)

Source from the content-addressed store, hash-verified

353 return self.__element._constructor
354
355 def _clone(self, **kw: Any) -> Self:
356 clone = self.__element._clone(**kw)
357 if clone is self.__element:
358 # detect immutable, don't change anything
359 return self
360 else:
361 # update the clone with any changes that have occurred
362 # to this object's __dict__.
363 clone.__dict__.update(self.__dict__)
364 return self.__class__(clone, self._annotations)
365
366 def __reduce__(self) -> Tuple[Type[Annotated], Tuple[Any, ...]]:
367 return self.__class__, (self.__element, self._annotations)

Callers 5

_deannotateMethod · 0.45
_annotateMethod · 0.45
_with_annotationsMethod · 0.45
_deannotateMethod · 0.45
cloneFunction · 0.45

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected