X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fvalue.py;h=c5c23fe6783ab9ca018da78a752b2126cc85bd70;hb=7bb4180f2758d78af3f4d539f6b3e4e1fa60335f;hp=22623c228f88e2ee21888841ba7f6c5cac465c02;hpb=2b4ea20edfcf8ff93be7fbb98dfde5b4ba574b8f;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/value.py b/src/bindings/python/bt2/bt2/value.py index 22623c22..c5c23fe6 100644 --- a/src/bindings/python/bt2/bt2/value.py +++ b/src/bindings/python/bt2/bt2/value.py @@ -312,6 +312,18 @@ class _IntegralValue(_NumericValue, 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 __eq__(self, other): + if not isinstance(other, numbers.Integral): + return super().__eq__(other) + + return self._value == int(other) + class _RealValue(_NumericValue, numbers.Real): pass