[Python-Dev] Status of json (simplejson) in cpython

Vinay Sajip vinay_sajip at yahoo.co.uk
Sat Apr 16 18:47:49 CEST 2011


Hi Antoine,

Antoine Pitrou <solipsis <at> pitrou.net> writes:

> What you're proposing doesn't address the question of who is going to
> do the ongoing maintenance.

I agree, my suggestion is orthogonal to the question of who maintains stdlib
json. But if the json module is languishing in comparison to simplejson, then
bringing the code bases closer together may be worthwhile. I've just been
experimenting with the feasibility of getting simplejson running on Python
3.x, and at present I have it working in the sense of all tests passing on
3.2. 

Bob has said he isn't interested in Python 3, but he has said that "if
someone contributes the code to make simplejson work in Python 3 I'm willing
to apply the patches run the tests against any future changes."

I take this to mean that Bob is undertaking to keep the codebase working in
both 2.x and 3.x in the future (though I'm sure he'll correct me if I've got it
wrong). 

I'm also assuming Bob will be receptive to patches which are functional
improvements added in stdlib json in 3.x, as his comments seem to indicate
that this is the case.

ISTM that for some library maintainers who are invested in 2.x and who don't
have the time or inclination to manage separate 2.x and 3.x codebases, a
common codebase is the way to go. This certainly seems to be the case for pip
and virtualenv, which we recently got running under Python 3 using a common
codebase approach. Certainly, the amount of work required for ongoing
maintenance can be much less, and only a little discipline is needed when
adding new code.

Bob made a comment in passing that simplejson (Python) is about as fast as
stdlib json (C extension), on 2.x. That may or may not prove to be the case on
3.x, but at least it is now possible to run simplejson on 3.x (Python only, so
far) to make a comparison.

It may be that no-one is willing or able to serve as an effective maintainer
of stdlib json, but assuming that Bob will continue to maintain and improve
simplejson and if an automatic mechanism for converting from a 3.x-compatible
simplejson to json can be made to work, that could be a way forward.

It's obviously early days to see how things will pan out, but it seems worth
exploring the avenue a little further, if Bob is amenable to this approach.

Regards,

Vinay



More information about the Python-Dev mailing list