[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 16/16] python/qemu: Add mypy type annotations
From: |
John Snow |
Subject: |
Re: [PATCH v2 16/16] python/qemu: Add mypy type annotations |
Date: |
Thu, 4 Jun 2020 14:53:32 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 6/4/20 10:50 AM, Kevin Wolf wrote:
> Am 02.06.2020 um 23:45 hat John Snow geschrieben:
>> These should all be purely annotations with no changes in behavior at
>> all. You need to be in the python folder, but you should be able to
>> confirm that these annotations are correct (or at least self-consistent)
>> by running `mypy --strict qemu`.
>>
>> Signed-off-by: John Snow <jsnow@redhat.com>
>
>> diff --git a/python/qemu/qtest.py b/python/qemu/qtest.py
>> index ae4661d4d3e..df6300cd4f7 100644
>> --- a/python/qemu/qtest.py
>> +++ b/python/qemu/qtest.py
>> @@ -24,6 +24,8 @@
>> Optional,
>> Sequence,
>> TextIO,
>> + Tuple,
>> + Union,
>> )
>>
>> from .machine import QEMUMachine
>> @@ -43,7 +45,8 @@ class QEMUQtestProtocol:
>> No conection is estabalished by __init__(), this is done
>> by the connect() or accept() methods.
>> """
>> - def __init__(self, address, server=False):
>> + def __init__(self, address: Union[Tuple[str, str], str],
>> + server: bool = False):
>
> Shouldn't this be SocketAddrT now?
>
> Kevin
>
Ah, yeah. I had intended it for QMP, but it obviously works here, too.
- [PATCH v2 10/16] python/machine.py: Handle None events in event_wait, (continued)
- [PATCH v2 10/16] python/machine.py: Handle None events in event_wait, John Snow, 2020/06/02
- [PATCH v2 12/16] python/machine.py: Add _qmp access shim, John Snow, 2020/06/02
- [PATCH v2 11/16] python/machine.py: use qmp.command, John Snow, 2020/06/02
- [PATCH v2 14/16] python/qemu: make 'args' style arguments immutable, John Snow, 2020/06/02
- [PATCH v2 13/16] python/machine.py: fix _popen access, John Snow, 2020/06/02
- [PATCH v2 15/16] iotests.py: Adjust HMP kwargs typing, John Snow, 2020/06/02
- [PATCH v2 16/16] python/qemu: Add mypy type annotations, John Snow, 2020/06/02
- Re: [PATCH v2 00/16] python: add mypy support to python/qemu, Eric Blake, 2020/06/02
- Re: [PATCH v2 00/16] python: add mypy support to python/qemu, Vladimir Sementsov-Ogievskiy, 2020/06/03
- Re: [PATCH v2 00/16] python: add mypy support to python/qemu, Kevin Wolf, 2020/06/04