Calling from_buffer_copy in the constructor of inherited ctypes.Structure class
问题 I have the following piece of code: class MyStruct(ctypes.Structure): _fields_= [('id', ctypes.uint), ('perm', ctypes.uint)] When the class is defined, i'm able to copy data from buffer directly on my fields. Eg: ms = MyStruct.from_buffer_copy("\xAA\xAA\xAA\xAA\x11\x11\x11\x11") print ms.id, ms.perm Everythings works fine, here id will be 0xAAAAAAAA and perm equals to 0x11111111 . Now, i tried to do the same thing during the instantiation, with the following code: class MyStruct(ctypes