How can I create my own datatype in python so that I could overwrite arithmetic operators?
问题 I am currently using Python/Numpy to deal with geographical/GPS data (loving it!), and I am facing the recurring task to calculate distances between geographical points defined by a coordinate pair pn = [lon, lat] . I have a function that I use like this: dist = geodistance(p1, p2) which is analog to euclidean distance in linear algebra (vector subtraction/difference), but occurs in geodesical (spherical) space instead of rectangular euclidean space. Programmatically, euclidean distance is