[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 03/28] qapi: Require ASCII in schema
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v5 03/28] qapi: Require ASCII in schema |
Date: |
Tue, 24 Mar 2015 14:33:19 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
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 <address@hidden>
> ---
> 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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v5 02/28] qapi: Fix generation of 'size' builtin type, (continued)
[Qemu-devel] [PATCH v5 03/28] qapi: Require ASCII in schema, Eric Blake, 2015/03/24
- Re: [Qemu-devel] [PATCH v5 03/28] qapi: Require ASCII in schema,
Eric Blake <=
[Qemu-devel] [PATCH v5 10/28] qapi: Segregate anonymous unions into alternates in generator, Eric Blake, 2015/03/24
[Qemu-devel] [PATCH v5 08/28] qapi: Better error messages for bad unions, Eric Blake, 2015/03/24
[Qemu-devel] [PATCH v5 04/28] qapi: Add some enum tests, Eric Blake, 2015/03/24