On Tue, Mar 18, 2008 at 8:32 PM, <[EMAIL PROTECTED]> wrote: > 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.
It's also a JavaScript thing, which is why that behavior was chosen. Yes it's silly, but no it has never caused anyone any (reported) problems in practice. -bob _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com