diff --git a/src/pkgcraft/dep/use.pyx b/src/pkgcraft/dep/use.pyx index 51208b6..3b9cc67 100644 --- a/src/pkgcraft/dep/use.pyx +++ b/src/pkgcraft/dep/use.pyx @@ -90,6 +90,16 @@ cdef class UseDep: inst.missing = UseDepDefault(ptr.missing[0]) return inst + def __lt__(self, other): + if isinstance(other, UseDep): + return C.pkgcraft_use_dep_cmp(self.ptr, (other).ptr) == -1 + return NotImplemented + + def __le__(self, other): + if isinstance(other, UseDep): + return C.pkgcraft_use_dep_cmp(self.ptr, (other).ptr) <= 0 + return NotImplemented + def __eq__(self, other): if isinstance(other, UseDep): return C.pkgcraft_use_dep_cmp(self.ptr, (other).ptr) == 0 @@ -100,6 +110,16 @@ cdef class UseDep: return C.pkgcraft_use_dep_cmp(self.ptr, (other).ptr) != 0 return NotImplemented + def __ge__(self, other): + if isinstance(other, UseDep): + return C.pkgcraft_use_dep_cmp(self.ptr, (other).ptr) >= 0 + return NotImplemented + + def __gt__(self, other): + if isinstance(other, UseDep): + return C.pkgcraft_use_dep_cmp(self.ptr, (other).ptr) == 1 + return NotImplemented + def __hash__(self): if not self._hash: self._hash = C.pkgcraft_use_dep_hash(self.ptr)