In function nearest_neighbor() the distance function used is self.dist(), instead of the passed-in function, which should just be called as dist().
Using self.dist() ends up always using the dist function defined in kdtree.py, and not the function passed in. PointKdtree::Point() tries to pass a distance function when calling kdtree::nearest_neighbor(), but it doesn't get used because of the problem just mentioned.
So just delete "self." in the two places where self.dist() appears in kdtree::nearest_neighbor().