[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 01/16] python/qmp.py: Define common types
From: |
John Snow |
Subject: |
[PATCH v3 01/16] python/qmp.py: Define common types |
Date: |
Thu, 4 Jun 2020 16:22:21 -0400 |
Define some common types that we'll need to annotate a lot of other
functions going forward.
Signed-off-by: John Snow <jsnow@redhat.com>
---
python/qemu/qmp.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index e64b6b5faa7..8388c7b6030 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -12,13 +12,31 @@
import socket
import logging
from typing import (
+ Any,
+ Dict,
Optional,
TextIO,
Type,
+ Tuple,
+ Union,
)
from types import TracebackType
+# QMPMessage is a QMP Message of any kind.
+# e.g. {'yee': 'haw'}
+#
+# QMPReturnValue is the inner value of return values only.
+# {'return': {}} is the QMPMessage,
+# {} is the QMPReturnValue.
+QMPMessage = Dict[str, Any]
+QMPReturnValue = Dict[str, Any]
+
+InternetAddrT = Tuple[str, str]
+UnixAddrT = str
+SocketAddrT = Union[InternetAddrT, UnixAddrT]
+
+
class QMPError(Exception):
"""
QMP base exception
--
2.21.3
[PATCH v3 10/16] python/machine.py: Handle None events in events_wait, John Snow, 2020/06/04
[PATCH v3 11/16] python/machine.py: use qmp.command, John Snow, 2020/06/04
[PATCH v3 15/16] iotests.py: Adjust HMP kwargs typing, John Snow, 2020/06/04
[PATCH v3 13/16] python/machine.py: fix _popen access, John Snow, 2020/06/04
[PATCH v3 14/16] python/qemu: make 'args' style arguments immutable, John Snow, 2020/06/04
[PATCH v3 16/16] python/qemu: Add mypy type annotations, John Snow, 2020/06/04
[PATCH v3 01/16] python/qmp.py: Define common types,
John Snow <=
Re: [PATCH v3 00/16] python: add mypy support to python/qemu, Kevin Wolf, 2020/06/05
- Re: [PATCH v3 00/16] python: add mypy support to python/qemu, John Snow, 2020/06/08
- Re: [PATCH v3 00/16] python: add mypy support to python/qemu, Kevin Wolf, 2020/06/08
- Re: [PATCH v3 00/16] python: add mypy support to python/qemu, Philippe Mathieu-Daudé, 2020/06/08
- Re: [PATCH v3 00/16] python: add mypy support to python/qemu, Markus Armbruster, 2020/06/09
- applying mailing list review tags (was: Re: [PATCH v3 00/16] python: add mypy support to python/qemu), John Snow, 2020/06/16
- Re: applying mailing list review tags (was: Re: [PATCH v3 00/16] python: add mypy support to python/qemu), Philippe Mathieu-Daudé, 2020/06/16
- Re: [PATCH v3 00/16] python: add mypy support to python/qemu, John Snow, 2020/06/17
- Re: applying mailing list review tags (was: Re: [PATCH v3 00/16] python: add mypy support to python/qemu), Paolo Bonzini, 2020/06/17
Re: [PATCH v3 00/16] python: add mypy support to python/qemu, Philippe Mathieu-Daudé, 2020/06/17