Python source code: myobject_test.py
obj = myobject.MyObject()
view = memoryview(obj)
print("shape", view.shape)
print("strides", view.strides)
print("format", view.format)
#
# If you also have Numpy for Python 3 ...
#
import numpy as np
x = np.asarray(obj)
print(x)
# this prints
#
# [[1 2]
# [3 4]]