[Python-3000] JSON nit

skip at pobox.com skip at pobox.com
Wed Mar 19 04:32:55 CET 2008


Regarding putting some JSON implementation in the standard library...

I suppose anyone who uses JSON is aware of its limitations, but this was a
bit disconcerting:

    >>> simplejson.loads(simplejson.dumps({1: 2}))
    {u'1': 2}

Silent type conversion is a Perl thing.  I would prefer it if it raised a
TypeError if I tried to encode something other than a string as a dictionary
key.

Skip




More information about the Python-3000 mailing list