MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / install_member

Method install_member

lib/sqlalchemy/orm/instrumentation.py:445–452  ·  view source on GitHub ↗
(self, key: str, implementation: Any)

Source from the content-addressed store, hash-verified

443 delattr(self.class_, key)
444
445 def install_member(self, key: str, implementation: Any) -> None:
446 if key in (self.STATE_ATTR, self.MANAGER_ATTR):
447 raise KeyError(
448 "%r: requested attribute name conflicts with "
449 "instrumentation attribute of the same name." % key
450 )
451 self.originals.setdefault(key, self.class_.__dict__.get(key, DEL_ATTR))
452 setattr(self.class_, key, implementation)
453
454 def uninstall_member(self, key: str) -> None:
455 original = self.originals.pop(key, None)

Callers 2

_instrument_initMethod · 0.95
set_cls_attributeMethod · 0.45

Calls 2

setdefaultMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected