X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=bindings%2Fpython%2Fwriter.py;h=f50b9d51fc25ec252cf9333fbf7a51f9e76ff9e3;hb=a1bdc25c9f9b67530ae3b1f611cc505897f93363;hp=18bcb3cee5cecf940e5ce5c2cefff97d0854ce5e;hpb=773edf13fcf6861fbf1467fa4e901b3685deab3f;p=babeltrace.git diff --git a/bindings/python/writer.py b/bindings/python/writer.py index 18bcb3ce..f50b9d51 100644 --- a/bindings/python/writer.py +++ b/bindings/python/writer.py @@ -1346,9 +1346,17 @@ class StructureField(Field): class VariantField(Field): + """ + Variant field, based on a + :class:`VariantFieldDeclaration` object. + """ + def field(self, tag): """ - Return the variant's selected field. The "tag" field is the selector enum field. + Returns the :class:`Field` selected by the current label of + *tag* (:class:`EnumerationField`). + + :exc:`ValueError` is raised on error. """ native_instance = nbt._bt_ctf_field_variant_get_field(self._f, tag._f) @@ -1360,9 +1368,17 @@ class VariantField(Field): class ArrayField(Field): + """ + Static array field, based on an + :class:`ArrayFieldDeclaration` object. + """ + def field(self, index): """ - Return the array's field at position "index". + Returns the :class:`Field` at index *index* in this static + array. + + :exc:`IndexError` is raised on error. """ native_instance = nbt._bt_ctf_field_array_get_field(self._f, index)