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

Function COMMETHOD

comtypes/_memberspec.py:192–212  ·  view source on GitHub ↗

Specifies a COM method slot with idlflags. XXX should explain the sematics of the arguments.

(idlflags, restype, methodname, *argspec)

Source from the content-addressed store, hash-verified

190
191
192def COMMETHOD(idlflags, restype, methodname, *argspec) -> _ComMemberSpec:
193 """Specifies a COM method slot with idlflags.
194
195 XXX should explain the sematics of the arguments.
196 """
197 # collect all helpstring instances
198 # We should suppress docstrings when Python is started with -OO
199 # join them together(does this make sense?) and replace by None if empty.
200 helptext = "".join(t for t in idlflags if isinstance(t, helpstring)) or None
201 paramflags, argtypes = _resolve_argspec(argspec)
202 if "propget" in idlflags:
203 name = f"_get_{methodname}"
204 elif "propput" in idlflags:
205 name = f"_set_{methodname}"
206 elif "propputref" in idlflags:
207 name = f"_setref_{methodname}"
208 else:
209 name = methodname
210 return _ComMemberSpec(
211 restype, name, argtypes, paramflags, tuple(idlflags), helptext
212 )
213
214
215################################################################

Callers 15

typeinfo.pyFile · 0.90
IProvideClassInfoClass · 0.90
IProvideClassInfo2Class · 0.90
IViewObjectClass · 0.90
IViewObject2Class · 0.90
IViewObjectExClass · 0.90
automation.pyFile · 0.90
IDispatchClass · 0.90
ISequentialStreamClass · 0.90
IShellLinkAClass · 0.90
IShellLinkWClass · 0.90

Calls 2

_resolve_argspecFunction · 0.85
_ComMemberSpecClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…