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

Stefan Behnel stefan_ml at behnel.de
Sat Apr 16 18:04:53 CEST 2011


Antoine Pitrou, 16.04.2011 16:19:
> On Sat, 16 Apr 2011 09:50:25 +0000 (UTC)
> Vinay Sajip wrote:
>>
>> If it is generally considered desirable to maintain some synchrony between
>> simplejson and stdlib json, then since Bob has stated that he no interest in
>> Python 3, it may be better to:
>>
>> 1. Convert the simplejson codebase so that it runs on both Python 2 and 3
>> (without running 2to3 on it). Once this is done, if upstream accepts these
>> changes, ongoing maintenance will be fairly simple for upstream, and changes
>> only really need to consider exception and string/byte literal syntax, for the
>> most part.
>> 2. Merge this new simplejson with stdlib json for 3.3.
>
> What you're proposing doesn't address the question of who is going to
> do the ongoing maintenance. Bob apparently isn't interested in
> maintaining stdlib code, and python-dev members aren't interested in
> maintaining simplejson (assuming it would be at all possible). Since
> both groups of people want to work on separate codebases, I don't see
> how sharing a single codebase would be possible.

Well, if that is not possible, then the CPython devs will have a hard time 
maintaining the json accelerator module in the long run. I quickly skipped 
through the github version in simplejson, and it truly is some complicated 
piece of code. Not in the sense that the code is ununderstandable, it's 
actually fairly straight forward string processing code, but it's so 
extremely optimised and tailored and has so much code duplicated for the 
bytes and unicode types (apparently following the copy+paste+adapt pattern) 
that it will be pretty hard to adapt to future changes of CPython, 
especially the upcoming PEP 393 implementation. Maintaining this is clearly 
no fun.

Stefan



More information about the Python-Dev mailing list