class Foo(object):

    def __init__(self):
        self.arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]], np.int32)

def __array__(self):
    return self.arr

def __iter__(self):
    for elem in self.arr:
        yield elem

def __len__(self):
    return len(self.arr)

def __getitem__(self, key):
    return self.arr[key]

def main():
    foos = [Foo() for i in range(10)]
print(np.array(foos))
if __name__ == '__main__':
    main()
numpy - transform a list of objects into an array without subclassing ndarray