[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of imp
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type |
Date: |
Tue, 6 Oct 2015 05:56:10 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 10/06/2015 02:32 AM, Markus Armbruster wrote:
>> If entity is an implicit ObjectType, return True. If it is implicit but
>> not an object (such as an implicit enum), or is not implicit (regardless
>> of whether it is an ObjectType), then return False.
>>
>> And if you don't need filtering by python type, then
>> entity.is_implicit() (shorthand for entity.is_implicit(None)) then gives
>> the correct answer whether entity is ObjectType or EnumType or something
>> else.
>
> I find
>
> isinstance(entity, QAPISchemaObjectType) and entity.is_implicit()
>
> more obvious than
>
> entity.is_implicit(QAPISchemaObjectType)
Well, I had already written v7 before this request of yours; do you want
to see how it turned out, before deciding if I need a v8 that throws the
isinstance check burden back on the caller?
http://thread.gmane.org/gmane.comp.emulators.qemu/366810/focus=366809
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v6 06/12] qapi: Track owner of each object member, (continued)
[Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Markus Armbruster, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Markus Armbruster, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Markus Armbruster, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Markus Armbruster, 2015/10/08
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type,
Eric Blake <=
- Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Markus Armbruster, 2015/10/08
Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type, Eric Blake, 2015/10/08
[Qemu-devel] [PATCH v6 05/12] qapi: Track location that created an implicit type, Eric Blake, 2015/10/08
[Qemu-devel] [PATCH v6 08/12] qapi: Defer duplicate member checks to schema check(), Eric Blake, 2015/10/08