[Python-Dev] Dropping bytes "support" in json
Nick Coghlan
ncoghlan at gmail.com
Fri Apr 10 10:40:28 CEST 2009
glyph at divmod.com wrote:
> On 03:21 am, ncoghlan at gmail.com wrote:
>> Given that json is a wire protocol, that sounds like the right approach
>> for json as well. Once bytes-everywhere works, then a text API can be
>> built on top of it, but it is difficult to build a bytes API on top of a
>> text one.
>
> I wish I could agree, but JSON isn't really a wire protocol. According
> to http://www.ietf.org/rfc/rfc4627.txt JSON is "a text format for the
> serialization of structured data". There are some notes about encoding,
> but it is very clearly described in terms of unicode code points.
Ah, my apologies - if the RFC defines things such that the native format
is Unicode, then yes, the appropriate Python 3.x data type for the base
implementation would indeed be strings.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
More information about the Python-Dev
mailing list