[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 35/38] qapi/types.py: remove one-letter variables
From: |
Eduardo Habkost |
Subject: |
Re: [PATCH v2 35/38] qapi/types.py: remove one-letter variables |
Date: |
Wed, 23 Sep 2020 15:14:36 -0400 |
On Tue, Sep 22, 2020 at 05:00:58PM -0400, John Snow wrote:
> "John, if pylint told you to jump off a bridge, would you?"
> Hey, if it looked like fun, I might.
>
> Now that this file is clean, enable pylint checks on this file.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
[...]
> @@ -148,11 +148,12 @@ def gen_object(name: str, ifcond: List[str],
> objects_seen.add(name)
>
> ret = ''
> - if variants:
> - for v in variants.variants:
> - if isinstance(v.type, QAPISchemaObjectType):
> - ret += gen_object(v.type.name, v.type.ifcond, v.type.base,
> - v.type.local_members, v.type.variants)
> + for variant in variants.variants if variants else ():
I'm not sure I like this weird expression, but I believe asking
for a 120-patch cleanup series to be respun because of a tiny
style issue would be counterproductive, so:
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
> + obj = variant.type
> + if not isinstance(obj, QAPISchemaObjectType):
> + continue
> + ret += gen_object(obj.name, obj.ifcond, obj.base,
> + obj.local_members, obj.variants)
>
> ret += mcgen('''
>
> --
> 2.26.2
>
--
Eduardo
[PATCH v2 33/38] qapi/introspect.py: add type hint annotations, John Snow, 2020/09/22
[PATCH v2 32/38] qapi/introspect.py: create a typed 'Node' data structure, John Snow, 2020/09/22
Re: [PATCH v2 00/38] qapi: static typing conversion, pt1, John Snow, 2020/09/24