[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 09/38] qapi/common.py: Add indent manager
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v2 09/38] qapi/common.py: Add indent manager |
Date: |
Fri, 25 Sep 2020 15:47:57 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Eduardo Habkost <ehabkost@redhat.com> writes:
> On Fri, Sep 25, 2020 at 01:51:54PM +0200, Markus Armbruster wrote:
>> John Snow <jsnow@redhat.com> writes:
>> > On 9/22/20 6:22 PM, Eduardo Habkost wrote:
> [...]
>> > Yeah, there's only one user right now, so ... I just kinda wanted to
>> > get rid of the global usage. Maybe if we make the code generator
>> > fancier we'll find out what form is best.
>>
>> You don't get rid of the global variable, you just change it from
>> integer to a class. A class can be handier when generating multiple
>> things interleaved, because you can have one class instance per thing.
>
> To be fair, John doesn't claim to be getting rid of a global
> variable. He's getting rid of usage of the 'global' keyword to
> make linters happier.
True.
> There are ways to do that without changing
> the code too much, though.
Let's do something easy and cheap, because ...
>> Note that we already have a class instance per thing we generate:
>> instances of subtypes of QAPIGen. The thought of moving the indentation
>> machinery into QAPIGen or or maybe QAPIGenCCode crossed my mind many
>> moons ago, but I had bigger fish to fry, and then I forgot :)
... we'll probably want to move this stuff into QAPIGen later, and
that's when we should make it pretty.
>> John, I suggest you don't try to make this pretty just yet. Do what
>> needs to be done for the type hint job. We can make it pretty later.
Re: [PATCH v2 09/38] qapi/common.py: Add indent manager, Cleber Rosa, 2020/09/23
[PATCH v2 05/38] qapi: Remove wildcard includes, John Snow, 2020/09/22