Merge pull request #475 from silbe/version-recursion-fix

Version: avoid infinite recursion
pull/482/head
Holger Müller 2022-03-11 08:40:47 +01:00 zatwierdzone przez GitHub
commit 4d4ff52c15
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -54,13 +54,13 @@ class Version:
return False
def __lt__(self, other: "Version") -> bool:
return other > self
return other.__gt__(self)
def __ge__(self, other: "Version") -> bool:
return self > other or self == other
return self.__gt__(other) or self.__eq__(other)
def __le__(self, other: "Version") -> bool:
return self < other or self == other
return other.__gt__(self) or self.__eq__(other)
def __eq__(self, other: "Version") -> bool:
return self.data == other.data