MCPcopy Create free account
hub / github.com/enthought/comtypes / Dispatch

Function Dispatch

comtypes/client/dynamic.py:21–33  ·  view source on GitHub ↗

Wrap an object in a Dispatch instance, exposing methods and properties via fully dynamic dispatch.

(obj)

Source from the content-addressed store, hash-verified

19
20
21def Dispatch(obj):
22 """Wrap an object in a Dispatch instance, exposing methods and properties
23 via fully dynamic dispatch.
24 """
25 if isinstance(obj, _Dispatch):
26 return obj
27 if isinstance(obj, ctypes.POINTER(automation.IDispatch)):
28 try:
29 tinfo = obj.GetTypeInfo(0)
30 except (OSError, COMError):
31 return _Dispatch(obj)
32 return lazybind.Dispatch(obj, tinfo)
33 return obj
34
35
36class MethodCaller:

Callers 4

_get_valueMethod · 0.90
create_objectMethod · 0.90
create_objectMethod · 0.90

Calls 2

_DispatchClass · 0.85
GetTypeInfoMethod · 0.45

Tested by 3

create_objectMethod · 0.72
create_objectMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…