MCPcopy Index your code
hub / github.com/ZeroIntensity/pointers.py / map_type

Function map_type

gen.py:369–384  ·  view source on GitHub ↗
(typ: type["ctypes._CData"] | None)

Source from the content-addressed store, hash-verified

367
368
369def map_type(typ: type["ctypes._CData"] | None) -> str:
370 if not typ:
371 return "None"
372 name = typ.__name__
373
374 if name.startswith("LP_"):
375 actual_name = name[3:]
376
377 for k, v in STRUCT_MAP.items():
378 s_name: str = k.__name__
379 if s_name == actual_name:
380 return f"StructPointer[{v.__name__}]"
381
382 return "PointerLike"
383
384 return CT_TYPES[name[2:] if name != "py_object" else name]
385
386
387def get_converter(data: str, typ: str) -> str:

Callers 1

mainFunction · 0.70

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected