Eric Blake <[email protected]> writes:

> 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

I certainly want to review your v7 first.

Reply via email to