[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 04/14] qapi: Don't use info as witness of imp
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v7 04/14] qapi: Don't use info as witness of implicit object type |
Date: |
Fri, 9 Oct 2015 16:41:55 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 10/07/2015 10:27 AM, Markus Armbruster wrote:
>> def visit_needed(self, entity):
>> # Visit everything except implicit objects
>> - return not isinstance(entity, QAPISchemaObjectType) or entity.info
>> + return not entity.is_implicit(QAPISchemaObjectType)
>
> The alternative is something like
>
> return not (isinstance(entity, QAPISchemaObjectType) and
> entity.is_implicit())
>
> Trades a more verbose "is this an implicit object type" check for a
> simpler is_implicit(). Shorter overall, and feels better to me. But if
> you feel strongly about your way of doing it, I can live with it.
I'm not strongly tied to the concise form enough to stall review, so v8
will use the longer explicit form.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v7 00/14] post-introspection cleanups, subset B, Eric Blake, 2015/10/08
- [Qemu-devel] [PATCH v7 12/14] qapi: Move duplicate enum value checks to schema check(), Eric Blake, 2015/10/08
- [Qemu-devel] [PATCH v7 02/14] qapi: Prepare for errors during check(), Eric Blake, 2015/10/08
- [Qemu-devel] [PATCH v7 04/14] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/10/08
- [Qemu-devel] [PATCH v7 06/14] qapi: Create simple union type member earlier, Eric Blake, 2015/10/08
- [Qemu-devel] [PATCH v7 07/14] qapi: Move union tag quirks into subclass, Eric Blake, 2015/10/08