Map the specified C type to a Python type.
(
data: Type["ctypes._CData"],
)
| 128 | |
| 129 | |
| 130 | def 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 | |
| 147 | def make_py(data: "ctypes._CData"): |
no outgoing calls
no test coverage detected