Fix: bt2: erroneous integer comparison of Field and Value
[babeltrace.git] / src / bindings / python / bt2 / bt2 / value.py
index 22623c228f88e2ee21888841ba7f6c5cac465c02..c5c23fe6783ab9ca018da78a752b2126cc85bd70 100644 (file)
@@ -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
This page took 0.023832 seconds and 4 git commands to generate.