From c2ea62f5c3978874e4a5cf346e476e5fbdbf79de Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 27 Jun 2019 23:39:21 -0400 Subject: [PATCH] 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 --- src/bindings/python/bt2/bt2/field.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) -- 2.34.1