In what language are you defining these custom arrays or types? certainly not in python, or they'll be too slow to be worthwhile.