def __ge__(self, other): try: other_type = other.type other_index = other.index except AttributeError: if not isinstance(other, IndexPattern): other_type = str(other) else: return False else: try: pattern_compare(self.index, other_index) except ValueError: return False return pattern_compare(self.type, other_type, -1) != -1
def __ge__(self, other): try: other_index = other.index except AttributeError: other_index = str(other) return pattern_compare(self.index, other_index, -1) != -1
def __gt__(self, other): try: other_field = other.field other_type = other.type other_index = other.index except AttributeError: if not isinstance(other, (IndexPattern, TypePattern)): other_field = str(other) else: return False else: try: pattern_compare(self.index, other_index) pattern_compare(self.type, other_type) except ValueError: return False return pattern_compare(self.field, other_field, -1) == 1