From: Philippe Proulx Date: Wed, 10 Dec 2014 03:09:47 +0000 (-0500) Subject: Python: document writer.ArrayFieldDeclaration X-Git-Tag: v2.0.0-pre1~1366 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=ee77cc1586dd7dcbbd4eee55f685454158ea23e2;p=babeltrace.git Python: document writer.ArrayFieldDeclaration 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 4841aa1c..65822fa4 100644 --- a/bindings/python/writer.py +++ b/bindings/python/writer.py @@ -962,9 +962,16 @@ class VariantFieldDeclaration(FieldDeclaration): class ArrayFieldDeclaration(FieldDeclaration): + """ + Static array field declaration. + """ + def __init__(self, element_type, length): """ - Create a new array field declaration. + Creates a static array field declaration of *length* + elements of type *element_type* (:class:`FieldDeclaration`). + + :exc:`ValueError` is raised on error. """ self._ft = nbt._bt_ctf_field_type_array_create(element_type._ft, @@ -974,7 +981,10 @@ class ArrayFieldDeclaration(FieldDeclaration): @property def element_type(self): """ - Get the array's element type. + Type of the elements of this this static array (subclass of + :class:`FieldDeclaration`). + + :exc:`TypeError` is raised on error. """ ret = nbt._bt_ctf_field_type_array_get_element_type(self._ft) @@ -987,7 +997,9 @@ class ArrayFieldDeclaration(FieldDeclaration): @property def length(self): """ - Get the array's length. + Length of this static array (integer). + + :exc:`TypeError` is raised on error. """ ret = nbt._bt_ctf_field_type_array_get_length(self._ft)