From: Philippe Proulx Date: Fri, 28 Jun 2019 03:39:21 +0000 (-0400) Subject: bt2: make `_ArrayField` inherit `collections.abc.MutableSequence` X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=c2ea62f5c3978874e4a5cf346e476e5fbdbf79de;hp=f00b8d402364ed0b77c45a61467c1d27690222f7;p=babeltrace.git bt2: make `_ArrayField` inherit `collections.abc.MutableSequence` An array field is conceptually a mutable sequence just like an array value (`ArrayValue`). Signed-off-by: Philippe Proulx Change-Id: Ia3f27fd524286e924b5529030963df33e7553336 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1562 Tested-by: jenkins Reviewed-by: Simon Marchi Reviewed-by: Francis Deslauriers --- diff --git a/src/bindings/python/bt2/bt2/field.py b/src/bindings/python/bt2/bt2/field.py index d35cb258..3a735ec3 100644 --- a/src/bindings/python/bt2/bt2/field.py +++ b/src/bindings/python/bt2/bt2/field.py @@ -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)