Arbitrary dimensions in python wrapper