qemu-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]