From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yb4Up-0005D1-7f for qemu-devel@nongnu.org; Thu, 26 Mar 2015 05:54:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yb4Uo-0002J5-AJ for qemu-devel@nongnu.org; Thu, 26 Mar 2015 05:54:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yb4Uo-0002Iv-1j for qemu-devel@nongnu.org; Thu, 26 Mar 2015 05:54:38 -0400 From: Markus Armbruster References: <1427227433-5030-1-git-send-email-eblake@redhat.com> <1427227433-5030-4-git-send-email-eblake@redhat.com> <5511CA0F.9070408@redhat.com> Date: Thu, 26 Mar 2015 10:54:33 +0100 In-Reply-To: <5511CA0F.9070408@redhat.com> (Eric Blake's message of "Tue, 24 Mar 2015 14:33:19 -0600") Message-ID: <87d23w6q3q.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v5 03/28] qapi: Require ASCII in schema List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, wenchaoqemu@gmail.com, lcapitulino@redhat.com Eric Blake writes: > On 03/24/2015 02:03 PM, Eric Blake wrote: >> Python 2 and Python 3 have a wild history of whether strings >> default to ascii or unicode, where Python 3 requires checking >> instanceof(foo, basestr) to cover all strings, but where that >> code is not portable to Python 2. It's simpler to just state >> that we don't care about Unicode strings, and to just always >> use the simpler instanceof(foo, str) everywhere. > > And for all my proof-reading, I already have a commit message change: > > s/instanceof/isinstance/ > > (you can tell I'm not that proficient in python...) > >> >> I'm no python expert, so I'm basing it on this conversation: >> https://lists.gnu.org/archive/html/qemu-devel/2014-09/msg05278.html >> >> Signed-off-by: Eric Blake >> --- >> scripts/qapi.py | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> > >> @@ -354,7 +354,7 @@ def parse_schema(input_file): >> return exprs >> >> def parse_args(typeinfo): >> - if isinstance(typeinfo, basestring): >> + if isinstance(typeinfo, str): > > at least the code is right. Yup. With the spelling fix: Reviewed-by: Markus Armbruster