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

Function _midlSAFEARRAY

comtypes/safearray.py:61–72  ·  view source on GitHub ↗

This function mimics the 'SAFEARRAY(aType)' IDL idiom. It returns a subtype of SAFEARRAY, instances will be built with a typecode VT_... corresponding to the aType, which must be one of the supported ctypes.

(itemtype: "type[_CT]")

Source from the content-addressed store, hash-verified

59################################################################
60# This is THE PUBLIC function: the gateway to the SAFEARRAY functionality.
61def _midlSAFEARRAY(itemtype: "type[_CT]") -> "type[hints.LP_SAFEARRAY[_CT]]":
62 """This function mimics the 'SAFEARRAY(aType)' IDL idiom. It
63 returns a subtype of SAFEARRAY, instances will be built with a
64 typecode VT_... corresponding to the aType, which must be one of
65 the supported ctypes.
66 """
67 try:
68 return POINTER(_safearray_type_cache[itemtype]) # type: ignore
69 except KeyError:
70 sa_type = _make_safearray_type(itemtype)
71 _safearray_type_cache[itemtype] = sa_type
72 return POINTER(sa_type) # type: ignore
73
74
75def _make_safearray_type(itemtype):

Callers 15

_set_valueMethod · 0.90
_get_valueMethod · 0.90
testMethod · 0.90
test_nested_contextsMethod · 0.85
test_UDT_ndarrayMethod · 0.85
test_VT_BOOL_ndarrayMethod · 0.85
test_VT_BSTR_ndarrayMethod · 0.85
test_VT_I4_ndarrayMethod · 0.85
test_VT_I8_ndarrayMethod · 0.85
test_arrayMethod · 0.85

Calls 1

_make_safearray_typeFunction · 0.85

Tested by 15

testMethod · 0.72
test_nested_contextsMethod · 0.68
test_UDT_ndarrayMethod · 0.68
test_VT_BOOL_ndarrayMethod · 0.68
test_VT_BSTR_ndarrayMethod · 0.68
test_VT_I4_ndarrayMethod · 0.68
test_VT_I8_ndarrayMethod · 0.68
test_arrayMethod · 0.68
test_equalityMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…