qemu-block
[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: Kevin Wolf
Subject: Re: [PATCH v2 16/16] python/qemu: Add mypy type annotations
Date: Thu, 4 Jun 2020 16:50:23 +0200

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




reply via email to

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