rtyler / py-yajl

py-yajl provides Python bindings for the Yajl JSON encoder/decoder library
http://rtyler.github.com/py-yajl
74 stars 18 forks source link

Integer keys in dicts #10

Closed indigoviolet closed 14 years ago

indigoviolet commented 14 years ago

In this case, I prefer what yajl does [failing to deserialize the data instead of what json does: convert the integer keys to strings]. It might be nicer to either (a) support integer keys or (b) fail on dumps(), instead of loads().

yajl.dumps({1:2}) '{1:2}'

yajl.loads(yajl.dumps({1:2}))

Traceback (most recent call last): File "", line 1, in ValueError: parse error

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

rtyler commented 14 years ago

Resolved in SHA: f40427c52c0b2ba657371fdcea98a631fa1363f8