Maybe here it is better to import stdlib json only with python >= 2.7, and try to use simplejson in 2.6, falling back to default json? In python 2.6 stdlib json is much slower than simplejson, and a lot of people still use 2.6