MCPcopy Create free account
hub / github.com/ZeroIntensity/pointers.py / get_py

Function get_py

src/pointers/_utils.py:130–144  ·  view source on GitHub ↗

Map the specified C type to a Python type.

(
    data: Type["ctypes._CData"],
)

Source from the content-addressed store, hash-verified

128
129
130def get_py(
131 data: Type["ctypes._CData"],
132) -> Type[Any]:
133 """Map the specified C type to a Python type."""
134 from .base_pointers import BaseCPointer
135
136 if data.__name__.startswith("LP_"):
137 return BaseCPointer
138
139 try:
140 return _PY_TYPES[data]
141 except KeyError as e:
142 raise ValueError(
143 f"{data} is not a valid ctypes type",
144 ) from e
145
146
147def make_py(data: "ctypes._CData"):

Callers 3

__getattribute__Method · 0.85
_process_argsFunction · 0.85
make_pyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected