[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 09/20] python/qemu: make 'args' style arguments immutable

From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 09/20] python/qemu: make 'args' style arguments immutable
Date: Wed, 7 Oct 2020 06:55:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 10/7/20 1:58 AM, John Snow wrote:
> These arguments don't need to be mutable and aren't really used as
> such. Clarify their types as immutable and adjust code to match where
> necessary.
> In general, It's probably best not to accept a user-defined mutable
> object and store it as internal object state unless there's a strong
> justification for doing so. Instead, try to use generic types as input
> with empty tuples as the default, and coerce to list where necessary.
> Signed-off-by: John Snow <jsnow@redhat.com>
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  python/qemu/machine.py | 30 +++++++++++++++++-------------
>  python/qemu/qtest.py   | 22 +++++++++++++++++-----
>  2 files changed, 34 insertions(+), 18 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

reply via email to

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