Received: from eggs.gnu.org ([2001:4830:134:3::10]:49569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjSLc-0002Pw-GW for qemu-devel@nongnu.org; Tue, 06 Oct 2015 09:32:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjSLY-0003Pp-Bu for qemu-devel@nongnu.org; Tue, 06 Oct 2015 09:32:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjSLY-0003P9-7M for qemu-devel@nongnu.org; Tue, 06 Oct 2015 09:32:00 -0400 From: Markus Armbruster References: <1443760312-656-1-git-send-email-eblake@redhat.com> <1443760312-656-3-git-send-email-eblake@redhat.com> <87eghdhhxy.fsf@blackfin.pond.sub.org> <560E7E74.5090600@redhat.com> <87mvw14ax3.fsf@blackfin.pond.sub.org> <560E95C0.5070302@redhat.com> <87a8s1p673.fsf@blackfin.pond.sub.org> <560EB77D.6000704@redhat.com> <87si5os8gj.fsf@blackfin.pond.sub.org> <5613B6DA.8010905@redhat.com> Date: Tue, 06 Oct 2015 15:31:56 +0200 In-Reply-To: <5613B6DA.8010905@redhat.com> (Eric Blake's message of "Tue, 6 Oct 2015 05:56:10 -0600") Message-ID: <87oagcm8c3.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v6 02/12] qapi: Don't use info as witness of implicit object type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: marcandre.lureau@redhat.com, qemu-devel@nongnu.org, ehabkost@redhat.com, Michael Roth Eric Blake 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.