[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: |
Thu, 24 Sep 2020 16:54:34 -0400 |
On Wed, Sep 23, 2020 at 06:11:01PM -0400, John Snow wrote:
> On 9/23/20 3:14 PM, Eduardo Habkost wrote:
> > 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>
>
> I was trying to reduce the indent level to accommodate the longer names, but
> python ternaries *are* pretty weird.
>
> It'd be nice to enforce always having a variants object instead (even if
> it's empty!) and then add __bool__ and __iter__ methods to
> QAPISchemaVariants such that you could always do:
>
> "if variants"
>
> or
>
> "for variant in variants"
>
> but we're not there just yet... should I just put it back the way it was,
> with the deep nesting?
I don't have a strong opinion. I got used to it after seeing the
same pattern being used a few times.
--
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