X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Ffield.py;h=f5b9b59645365bcfcca2079101986fa516109602;hb=7bb4180f2758d78af3f4d539f6b3e4e1fa60335f;hp=99daff5a036a675f090a39c5cbf2029b1704f900;hpb=2b4ea20edfcf8ff93be7fbb98dfde5b4ba574b8f;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/field.py b/src/bindings/python/bt2/bt2/field.py index 99daff5a..f5b9b596 100644 --- a/src/bindings/python/bt2/bt2/field.py +++ b/src/bindings/python/bt2/bt2/field.py @@ -250,6 +250,18 @@ class _IntegralField(_NumericField, numbers.Integral): self.value = self | other return self + def __lt__(self, other): + if not isinstance(other, numbers.Integral): + return super().__lt__(other); + + return self._value < int(other) + + def _spec_eq(self, other): + if not isinstance(other, numbers.Integral): + return super()._spec_eq(other); + + return self._value == int(other) + class _IntegerField(_IntegralField, _Field): pass