qemu-devel
[Top][All Lists]
Advanced

[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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]