File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,6 +213,11 @@ class Blocker(IntEnum):
213213 C.pkgcraft_str_free(c_str)
214214 return s
215215
216+ def __eq__ (self , object other ):
217+ if isinstance (other, str ):
218+ return str (self ) == other
219+ return self is other
220+
216221
217222class SlotOperator (IntEnum ):
218223 Equal = C.SLOT_OPERATOR_EQUAL
@@ -231,6 +236,11 @@ class SlotOperator(IntEnum):
231236 C.pkgcraft_str_free(c_str)
232237 return s
233238
239+ def __eq__ (self , object other ):
240+ if isinstance (other, str ):
241+ return str (self ) == other
242+ return self is other
243+
234244
235245@cython.final
236246cdef class Atom(Cpv):
Original file line number Diff line number Diff line change @@ -84,9 +84,11 @@ def test_init(self):
8484 assert a .category == "cat"
8585 assert a .package == "pkg"
8686 assert a .blocker is Blocker .Strong
87+ assert a .blocker == "!!"
8788 assert a .slot == "0"
8889 assert a .subslot == "2"
8990 assert a .slot_op is SlotOperator .Equal
91+ assert a .slot_op == "="
9092 assert a .use == ("a" , "b" , "c" )
9193 assert a .repo == "repo"
9294 assert a .version == VersionWithOp ("=1-r2" )
You can’t perform that action at this time.
0 commit comments