Received: from eggs.gnu.org ([2001:4830:134:3::10]:43178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcbIN-0001sw-6L for qemu-devel@nongnu.org; Thu, 17 Sep 2015 11:40:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcbIJ-00076F-3w for qemu-devel@nongnu.org; Thu, 17 Sep 2015 11:40:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcbII-000762-VC for qemu-devel@nongnu.org; Thu, 17 Sep 2015 11:40:19 -0400 From: Markus Armbruster References: <1442401589-24189-1-git-send-email-armbru@redhat.com> <1442401589-24189-3-git-send-email-armbru@redhat.com> <55F985D2.90802@redhat.com> <87si6dfq1f.fsf@blackfin.pond.sub.org> Date: Thu, 17 Sep 2015 17:40:15 +0200 In-Reply-To: <87si6dfq1f.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Thu, 17 Sep 2015 09:44:44 +0200") Message-ID: <87vbb9caw0.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v8 02/26] qapi: New QAPISchema intermediate reperesentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Markus Armbruster writes: > Eric Blake writes: > >> On 09/16/2015 05:06 AM, Markus Armbruster wrote: >>> The QAPI code generators work with a syntax tree (nested dictionaries) >>> plus a few symbol tables (also dictionaries) on the side. >> >>> Nothing uses the new intermediate representation just yet, thus no >>> change to generated files. >>> >>> Signed-off-by: Markus Armbruster >>> --- >> >> >>> +class QAPISchemaEnumType(QAPISchemaType): >>> + def __init__(self, name, info, values, prefix): >>> + QAPISchemaType.__init__(self, name, info) >>> + for v in values: >>> + assert isinstance(v, str) >>> + self.values = values >>> + self.prefix = prefix >> >> Missing: >> assert prefix is None or isinstance(prefix, str) > > Yes. > >> Should this be self._prefix, since no clients ever directly use the >> member field (they just use the string passed through the visitor)? > > Yes. Second thoughts: I'll keep self.prefix for consistency. So far, we use the _-prefix only for instance variables holding values flowing from __init__() to check(). > If nothing else comes up in review, I'll touch this up on commit. > >> Reviewed-by: Eric Blake > > Thanks!