bt2: value.py: refactor value comparison
[babeltrace.git] / src / bindings / python / bt2 / bt2 / field.py
index 99daff5a036a675f090a39c5cbf2029b1704f900..3a735ec3ca4293c50088f7ba2c9132f48271cfbe 100644 (file)
@@ -99,13 +99,13 @@ class _NumericField(_Field):
             raise TypeError('unorderable types: {}() < {}()'.format(self.__class__.__name__,
                                                                     other.__class__.__name__))
 
-        return self._value < float(other)
+        return self._value < self._extract_value(other)
 
     def _spec_eq(self, other):
         if not isinstance(other, numbers.Number):
             return NotImplemented
 
-        return self._value == complex(other)
+        return self._value == self._extract_value(other)
 
     def __rmod__(self, other):
         return self._extract_value(other) % self._value
@@ -525,8 +525,7 @@ class _VariantField(_ContainerField, _Field):
     value = property(fset=_set_value)
 
 
-class _ArrayField(_ContainerField, _Field):
-
+class _ArrayField(_ContainerField, _Field, collections.abc.MutableSequence):
     def _get_length(self):
         return native_bt.field_array_get_length(self._ptr)
 
This page took 0.023986 seconds and 4 git commands to generate.