From 7e06e400642ed52997c60681631d827332bf67df Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 23 Nov 2017 11:57:26 -0500 Subject: [PATCH] Implement __repr__ for _ArraySequenceField MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Philippe Proulx Reviewed-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- bindings/python/bt2/bt2/fields.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bindings/python/bt2/bt2/fields.py b/bindings/python/bt2/bt2/fields.py index 8d315eb5..e24bf5f2 100644 --- a/bindings/python/bt2/bt2/fields.py +++ b/bindings/python/bt2/bt2/fields.py @@ -629,6 +629,9 @@ class _ArraySequenceField(_ContainerField, collections.abc.MutableSequence): def _value(self): return [field._value for field in self] + def __repr__(self): + return '[{}]'.format(', '.join([repr(v) for v in self])) + class _ArrayField(_ArraySequenceField): _NAME = 'Array' -- 2.34.1