def __hash__(self): """ hash(my_number_plate) will use this method, ie, it will return the hash value for my_number_plate. """ StatCounter.increment(HASHES) return _fnv32a_hash(self._plate)
def __ge__(self, other): if not isinstance(other, NumberPlate): raise ValueError(COMPARISON_TYPE_ERROR) StatCounter.increment(COMPS) return self._plate >= other._plate
def __ne__(self, other): if not isinstance(other, NumberPlate): raise TypeError(PLATE_COMPARISON_TYPE_ERROR) StatCounter.increment(PLATE_COMPS) return self._plate != other._plate
def __eq__(self, other): if not isinstance(other, NumberPlate): print(type(other)) raise TypeError(COMPARISON_TYPE_ERROR) StatCounter.increment(COMPS) return self._plate == other._plate
def __ge__(self, other): if not isinstance(other, Priority): raise ValueError(PRIORITY_COMPARISON_TYPE_ERROR) StatCounter.increment(PRIORITY_COMPS) return self._priority >= other._priority