MCPcopy Create free account
hub / github.com/apache/qpid-proton / put_array

Method put_array

python/proton/_data.py:863–892  ·  view source on GitHub ↗

Puts an array value. Elements may be filled by entering the array node and putting the element values. The values must all be of the specified array element type. If an array is described then the first child value of the array is the descriptor and may be of any

(self, described: bool, element_type: int)

Source from the content-addressed store, hash-verified

861 self._check(pn_data_put_map(self._data))
862
863 def put_array(self, described: bool, element_type: int) -> None:
864 """
865 Puts an array value. Elements may be filled by entering the array
866 node and putting the element values. The values must all be of the
867 specified array element type. If an array is described then the
868 first child value of the array is the descriptor and may be of any
869 type.
870
871 >>> data = Data()
872 >>>
873 >>> data.put_array(False, Data.INT)
874 >>> data.enter()
875 >>> data.put_int(1)
876 >>> data.put_int(2)
877 >>> data.put_int(3)
878 >>> data.exit()
879 >>>
880 >>> data.put_array(True, Data.DOUBLE)
881 >>> data.enter()
882 >>> data.put_symbol("array-descriptor")
883 >>> data.put_double(1.1)
884 >>> data.put_double(1.2)
885 >>> data.put_double(1.3)
886 >>> data.exit()
887
888 :param described: specifies whether the array is described
889 :param element_type: the type of the array elements
890 :raise: :exc:`DataException` if there is a Proton error.
891 """
892 self._check(pn_data_put_array(self._data, described, element_type))
893
894 def put_described(self) -> None:
895 """

Callers 4

put_py_arrayMethod · 0.95
_testArrayMethod · 0.80
__call__Method · 0.80
ProtonClass · 0.80

Calls 2

_checkMethod · 0.95
pn_data_put_arrayFunction · 0.85

Tested by

no test coverage detected