qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 10/16] qapi/expr.py: Remove single-letter variable


From: Markus Armbruster
Subject: Re: [PATCH v3 10/16] qapi/expr.py: Remove single-letter variable
Date: Thu, 25 Feb 2021 15:03:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Why?  Is it to appease a style checker?

I disagree with a blanket ban of single-letter variable names.

If @f is deemed too terrible to live, then I'd prefer @feat over
@feature, because it's more visually distant to @features.

John Snow <jsnow@redhat.com> writes:

> Signed-off-by: John Snow <jsnow@redhat.com>
> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
> Reviewed-by: Cleber Rosa <crosa@redhat.com>
> ---
>  scripts/qapi/expr.py | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py
> index 3235a3b809e..473ee4f7f7e 100644
> --- a/scripts/qapi/expr.py
> +++ b/scripts/qapi/expr.py
> @@ -214,14 +214,14 @@ def check_features(features: Optional[object],
>          raise QAPISemError(info, "'features' must be an array")
>      features[:] = [f if isinstance(f, dict) else {'name': f}
>                     for f in features]
> -    for f in features:
> +    for feature in features:
>          source = "'features' member"
> -        assert isinstance(f, dict)
> -        check_keys(f, info, source, ['name'], ['if'])
> -        check_name_is_str(f['name'], info, source)
> -        source = "%s '%s'" % (source, f['name'])
> -        check_name_str(f['name'], info, source)
> -        check_if(f, info, source)
> +        assert isinstance(feature, dict)
> +        check_keys(feature, info, source, ['name'], ['if'])
> +        check_name_is_str(feature['name'], info, source)
> +        source = "%s '%s'" % (source, feature['name'])
> +        check_name_str(feature['name'], info, source)
> +        check_if(feature, info, source)
>  
>  
>  def check_enum(expr: Expression, info: QAPISourceInfo) -> None:




reply via email to

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