bt2: make `_ArrayField` inherit `collections.abc.MutableSequence`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 28 Jun 2019 03:39:21 +0000 (23:39 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 3 Jul 2019 01:31:27 +0000 (21:31 -0400)
An array field is conceptually a mutable sequence just like an array
value (`ArrayValue`).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ia3f27fd524286e924b5529030963df33e7553336
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1562
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/bindings/python/bt2/bt2/field.py

index d35cb25887f4752e299167f689a9589903e159e4..3a735ec3ca4293c50088f7ba2c9132f48271cfbe 100644 (file)
@@ -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.032201 seconds and 4 git commands to generate.