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

Method __init_subclass__

src/pointers/structure.py:81–99  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

79 self._sync()
80
81 def __init_subclass__(cls):
82 hints = cls.__annotations__
83 cls._void_p = []
84 cls._hints = {
85 k: cls._convert_tc_ptr(v, k)
86 for k, v in hints.items()
87 if k not in {"_hints", "_void_p", "_internal_struct"}
88 }
89
90 class _InternalStruct(ctypes.Structure):
91 _fields_ = [
92 (
93 name,
94 cls._get_type(get_mapped(typ), name),
95 )
96 for name, typ in cls._hints.items() # fmt: off
97 ]
98
99 cls._internal_struct = _InternalStruct
100
101 @property
102 def _as_parameter_(self) -> ctypes.Structure:

Callers

nothing calls this directly

Calls 2

_convert_tc_ptrMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected