The reason in the past used to be that simplejson was way faster than the included json but now they are pretty similar in speed. Do I get any benefits sticking with simplejson anymore or should I switch all my code over to the included json now?
Asked
Active
Viewed 297 times
2 Answers
2
One practical difference is that when loading JSON strings, the json module will always return a Python unicode object, but simplejson will return a str (byte string) unless the JSON string contains Unicode code points:
>>> json.loads('"test"')
u'test'
>>> simplejson.loads('"test"')
'test'
>>> simplejson.loads('"\\u1000"')
u'\u1000'
So, you may want to stick with simplejson if you have poorly written code that can't handle unicode returns when loading JSON (I say poorly written because simplejson.loads()
will return unicode depending on the JSON string).

Andrew Clark
- 202,379
- 35
- 273
- 306
-1
Google appengine doesn't support json. On top of that simplejson is more updated than json

Qurben
- 1,276
- 1
- 10
- 21