2

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?

1

2 Answers 2

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).

Sign up to request clarification or add additional context in comments.

Comments

-1

Google appengine doesn't support json. On top of that simplejson is more updated than json

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.