From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjQqy-0006NT-S8 for qemu-devel@nongnu.org; Tue, 06 Oct 2015 07:56:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjQqv-0005SI-Ln for qemu-devel@nongnu.org; Tue, 06 Oct 2015 07:56:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjQqv-0005S2-GY for qemu-devel@nongnu.org; Tue, 06 Oct 2015 07:56:17 -0400 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> From: Eric Blake Message-ID: <5613B6DA.8010905@redhat.com> Date: Tue, 6 Oct 2015 05:56:10 -0600 MIME-Version: 1.0 In-Reply-To: <87si5os8gj.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ujqaUsMo9ULql5XM1rwc8P30ea5Rtiuof" 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: Markus Armbruster Cc: qemu-devel@nongnu.org, marcandre.lureau@redhat.com, Michael Roth , ehabkost@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ujqaUsMo9ULql5XM1rwc8P30ea5Rtiuof Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/06/2015 02:32 AM, Markus Armbruster wrote: >> If entity is an implicit ObjectType, return True. If it is implicit bu= t >> not an object (such as an implicit enum), or is not implicit (regardle= ss >> 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 giv= es >> the correct answer whether entity is ObjectType or EnumType or somethi= ng >> else. >=20 > I find >=20 > isinstance(entity, QAPISchemaObjectType) and entity.is_implicit() >=20 > more obvious than >=20 > 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=3D366809 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ujqaUsMo9ULql5XM1rwc8P30ea5Rtiuof Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWE7baAAoJEKeha0olJ0Nqub4H/RXK2qf646EPmK1Z/WIqhFMJ DWrVFLsBiaAp6GcRiuJQQOSIfhJ5i8AiDpjHFoMvvbMTRul3q9Ir7lYslpFbMlvJ PGWSkWe7o73RWct7WbDrk2JshMVaaGj6Nt1vZ3zkNPJ8LNh8foYrXT/ZKU2ngdV+ Z95DSepzNBHP4N4D9paLlRt32qy+hX1wzMSKV5IKQlyP5y+MoUsBQeBPt9llbKda 7ASj7b4/HidU3juXd5NGZjhXapSPKKRGWbW24vLsYSmilP2WO0sarwjOF0hNbpLQ DesuiQeW1VWE/7vvFQrNNQF4mwqC0CgVHhBwtvuPg/QRUMmrn3aTDcO7vfqt7y0= =d1RB -----END PGP SIGNATURE----- --ujqaUsMo9ULql5XM1rwc8P30ea5Rtiuof--