MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _reset

Method _reset

lib/sqlalchemy/orm/state.py:682–692  ·  view source on GitHub ↗

Remove the given attribute and any callables associated with it.

(self, dict_: _InstanceDict, key: str)

Source from the content-addressed store, hash-verified

680 state_dict["manager"](self, inst, state_dict)
681
682 def _reset(self, dict_: _InstanceDict, key: str) -> None:
683 """Remove the given attribute and any
684 callables associated with it."""
685
686 old = dict_.pop(key, None)
687 manager_impl = self.manager[key].impl
688 if old is not None and is_collection_impl(manager_impl):
689 manager_impl._invalidate_collection(old)
690 self.expired_attributes.discard(key)
691 if self.callables:
692 self.callables.pop(key, None)
693
694 def _copy_callables(self, from_: InstanceState[Any]) -> None:
695 if "callables" in from_.__dict__:

Callers 4

_reloadMethod · 0.45
_replaceMethod · 0.45
test_pop_existingMethod · 0.45

Calls 4

is_collection_implFunction · 0.85
popMethod · 0.45
discardMethod · 0.45

Tested by 1

test_pop_existingMethod · 0.36