diff options
| author | John Snow <jsnow@redhat.com> | 2025-08-26 13:04:50 -0400 |
|---|---|---|
| committer | John Snow <jsnow@redhat.com> | 2025-09-15 14:36:01 -0400 |
| commit | f414048e32262830e06d50240b2f15b6e5857efe (patch) | |
| tree | 3d2301e63c94e439617bfb9accc9c788ca36c2fd /python/qemu/qmp/message.py | |
| parent | 85f223e5b031eb8ab63fbca314a4fb296a3a2632 (diff) | |
| download | focaccia-qemu-f414048e32262830e06d50240b2f15b6e5857efe.tar.gz focaccia-qemu-f414048e32262830e06d50240b2f15b6e5857efe.zip | |
python: synchronize qemu.qmp documentation
This patch collects comments and documentation changes from many commits in the python-qemu-qmp repository; bringing the qemu.git copy in bit-identical alignment with the standalone library *except* for several copyright messages that reference the "LICENSE" file which is, for QEMU, named "COPYING" instead and are therefore left unchanged. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'python/qemu/qmp/message.py')
| -rw-r--r-- | python/qemu/qmp/message.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/python/qemu/qmp/message.py b/python/qemu/qmp/message.py index c2e9dd0dd5..dabb8ec360 100644 --- a/python/qemu/qmp/message.py +++ b/python/qemu/qmp/message.py @@ -28,7 +28,8 @@ class Message(MutableMapping[str, object]): be instantiated from either another mapping (like a `dict`), or from raw `bytes` that still need to be deserialized. - Once instantiated, it may be treated like any other MutableMapping:: + Once instantiated, it may be treated like any other + :py:obj:`~collections.abc.MutableMapping`:: >>> msg = Message(b'{"hello": "world"}') >>> assert msg['hello'] == 'world' @@ -50,12 +51,19 @@ class Message(MutableMapping[str, object]): >>> dict(msg) {'hello': 'world'} + Or pretty-printed:: + + >>> print(str(msg)) + { + "hello": "world" + } :param value: Initial value, if any. :param eager: When `True`, attempt to serialize or deserialize the initial value immediately, so that conversion exceptions are raised during the call to ``__init__()``. + """ # pylint: disable=too-many-ancestors |