What are the differences between json and simplejson Python modules?


json is simplejson, added to the stdlib. But since json was added in 2.6, simplejson has the advantage of working on more Python versions (2.4+).

simplejson is also updated more frequently than Python. Although they are the same, the version included in the stdlib doesn't include the latest optimizations. So if you need (or want) the latest version, it's best to use simplejson itself, if possible.

A good practice, is to use one or the other as a fallback. For example,

try: import simplejson as json
except ImportError: import json

Updated on: 30-Sep-2019

632 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements