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 <js...@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 <ehabk...@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