From: Philippe Proulx Date: Wed, 10 Dec 2014 18:14:41 +0000 (-0500) Subject: Python: document writer.SequenceField X-Git-Tag: v2.0.0-pre1~1356 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=4ac159aa28ef36821c55290056fcab6254bb8d41 Python: document writer.SequenceField Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/bindings/python/writer.py b/bindings/python/writer.py index f50b9d51..d862cd82 100644 --- a/bindings/python/writer.py +++ b/bindings/python/writer.py @@ -1390,10 +1390,20 @@ class ArrayField(Field): class SequenceField(Field): + """ + Sequence (dynamic array) field, based on a + :class:`SequenceFieldDeclaration` object. + """ + @property def length(self): """ - Get the sequence's length field (IntegerField). + Sequence length (:class:`IntegerField`). + + Set this attribute to change the sequence length's integer + field (integer must be unsigned). + + :exc:`ValueError` or :exc:`TypeError` are raised on error. """ native_instance = nbt._bt_ctf_field_sequence_get_length(self._f) @@ -1405,10 +1415,6 @@ class SequenceField(Field): @length.setter def length(self, length_field): - """ - Set the sequence's length field (IntegerField). - """ - if not isinstance(length_field, IntegerField): raise TypeError("Invalid length field.") @@ -1422,7 +1428,9 @@ class SequenceField(Field): def field(self, index): """ - Return the sequence's field at position "index". + Returns the :class:`Field` at index *index* in this sequence. + + :exc:`ValueError` is raised on error. """ native_instance = nbt._bt_ctf_field_sequence_get_field(self._f, index)