MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / is_instrumented

Function is_instrumented

lib/sqlalchemy/orm/instrumentation.py:691–701  ·  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

689
690
691def is_instrumented(instance, key):
692 """Return True if the given attribute on the given instance is
693 instrumented by the attributes package.
694
695 This function may be used regardless of instrumentation
696 applied directly to the class, i.e. no descriptors are required.
697
698 """
699 return manager_of_class(instance.__class__).is_instrumented(
700 key, search=True
701 )
702
703
704def _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