Closed
Description
>>> class Struct(ctypes.Structure):
... fields = [('a', ctypes.c_int16)]
>>> arr = (Struct*3)()
>>> np.ctypeslib.as_array(arr)
AttributeError: 'Struct' object has no attribute '__array_interface__'
# hmm
>>> pointer = ctypes.pointer(arr[0])
>>> np.ctypeslib.as_array(pointer, shape=(3,))
array([None, None, None], dtype=object)
# wat
>>> pointer_all = ctypes.pointer(arr)
>>> np.ctypeslib.as_array(pointer_all, shape=())
array(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
dtype='|V24')
# wat