Storing instances using jsonpickle

Ned Batchelder ned at nedbatchelder.com
Fri Sep 5 16:50:47 EDT 2014


On 9/5/14 2:04 PM, Marko Rauhamaa wrote:
> Ned Batchelder <ned at nedbatchelder.com>:
>
>> I don't understand how JSON has flopped? The parser may be a bit more
>> complex (but not much, it isn't hard to examine the first few bytes),
>> but you're using off-the-shelf parsers anyway, so why are you
>> concerned by this?
>
> There are occasions where you need to take shortcuts. Say you need to
> glean information from JSON with bash, grep, awk or straight C. If JSON
> was fixed to UTF-8, that would be quite feasible. Being as it is, you
> are bound to 3rd-party libraries.
>
> That alone invites ad-hoc encodings. For example, I have run into
> "asterisked" JSON, libraries that limit themselves to UTF-8.
>
> Compare that with HTTP, SMTP, or even XML(!). They fix the encoding to
> the bit. No need for completely unnecessary options.

I see what you mean about JSON, but you are mistaken about HTTP and XML. 
Neither of them dictates the encoding of the data, and both of them 
offer ways to declare the encoding.  This means XML parsers must be 
prepared for many different encodings.

>
>
> Marko
>


-- 
Ned Batchelder, http://nedbatchelder.com




More information about the Python-list mailing list