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)
| 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(), |
nothing calls this directly
no test coverage detected