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

Function make_py

src/pointers/_utils.py:147–155  ·  view source on GitHub ↗

Convert the target C value to a Python object.

(data: "ctypes._CData")

Source from the content-addressed store, hash-verified

145
146
147def make_py(data: "ctypes._CData"):
148 """Convert the target C value to a Python object."""
149 typ = get_py(type(data))
150 res = typ(data)
151
152 if typ is bytes:
153 res = attempt_decode(res)
154
155 return res
156
157
158def force_set_attr(typ: Type[Any], key: str, value: Any) -> None:

Callers

nothing calls this directly

Calls 2

get_pyFunction · 0.85
attempt_decodeFunction · 0.85

Tested by

no test coverage detected