MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / is_instrumented

Function is_instrumented

lib/sqlalchemy/orm/instrumentation.py:699–709  ·  view source on GitHub ↗

Return True if the given attribute on the given instance is instrumented by the attributes package. This function may be used regardless of instrumentation applied directly to the class, i.e. no descriptors are required.

(instance, key)

Source from the content-addressed store, hash-verified

697
698
699def is_instrumented(instance, key):
700 """Return True if the given attribute on the given instance is
701 instrumented by the attributes package.
702
703 This function may be used regardless of instrumentation
704 applied directly to the class, i.e. no descriptors are required.
705
706 """
707 return manager_of_class(instance.__class__).is_instrumented(
708 key, search=True
709 )
710
711
712def _generate_init(class_, class_manager, original_init):

Callers 7

__getattr__Method · 0.90
__setattr__Method · 0.90
__hasattr__Method · 0.90
__delattr__Method · 0.90
__getattr__Method · 0.90
__setattr__Method · 0.90
__delattr__Method · 0.90

Calls 2

manager_of_classFunction · 0.85
is_instrumentedMethod · 0.80

Tested by 4

__getattr__Method · 0.72
__setattr__Method · 0.72
__hasattr__Method · 0.72
__delattr__Method · 0.72