def byDistanceTo(x, y=None): """ Method to compare two Region objects by distance of their top left. or a regions top left to the given point by coordinates""" return DistanceComparator(x, y)
def distanceComparator(x, y=None): """ Method to compare two Region objects by distance of their top left. or a regions top left to the given point by coordinates""" if y is None: return DistanceComparator(x).compare # x is Region or Location return DistanceComparator(x, y).compare # x/y as coordinates