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

Method put_py_array

python/proton/_data.py:1543–1561  ·  view source on GitHub ↗

A convenience method for encoding an :class:`Array` object as an AMQP array. This method encapsulates the steps described in :func:`put_array` into a single function. :param a: The array object to be encoded :raise: :exc:`DataException` if there is a Proton

(self, a: Array)

Source from the content-addressed store, hash-verified

1541 return Array(descriptor, type, *elements)
1542
1543 def put_py_array(self, a: Array) -> None:
1544 """
1545 A convenience method for encoding an :class:`Array` object as
1546 an AMQP array. This method encapsulates the steps described in
1547 :func:`put_array` into a single function.
1548
1549 :param a: The array object to be encoded
1550 :raise: :exc:`DataException` if there is a Proton error.
1551 """
1552 described = a.descriptor != UNDESCRIBED
1553 self.put_array(described, a.type)
1554 self.enter()
1555 try:
1556 if described:
1557 self.put_object(a.descriptor)
1558 for e in a.elements:
1559 self.put_object(e)
1560 finally:
1561 self.exit()
1562
1563 put_mappings = {
1564 None.__class__: lambda s, _: s.put_null(),

Callers

nothing calls this directly

Calls 4

put_arrayMethod · 0.95
enterMethod · 0.95
put_objectMethod · 0.95
exitMethod · 0.95

Tested by

no test coverage detected