simplejson maintains Python 2.4+ compatibility, but json maintains 2.6+. I could produce another patch that ...
15 years, 10 months ago
(2009-02-28 10:02:57 UTC)
#3
simplejson maintains Python 2.4+ compatibility, but json maintains 2.6+. I could
produce another patch that manually removes these few remaining nits if it's
necessary.
http://codereview.appspot.com/20095/diff/1/13
File Lib/json/decoder.py (right):
http://codereview.appspot.com/20095/diff/1/13#newcode21
Line 21: nan, inf = struct.unpack('dd', _BYTES)
On 2009/02/28 09:28:11, Martin v. Löwis wrote:
> I think this can be simplified as
>
> nan, inf = struct.unpack('>dd', _BYTES)
Not while maintaining Python 2.4 compatibility, you will get frexp() out of
range. I suppose that this could be another function that gets manually fixed up
for Python's json module (like the .format strings) but it really doesn't seem
that important. I have added a comment to this effect in r175 of simplejson
http://codereview.appspot.com/20095/diff/1/12
File Lib/json/encoder.py (right):
http://codereview.appspot.com/20095/diff/1/12#newcode31
Line 31: INFINITY = float('1e66666')
On 2009/02/28 09:28:11, Martin v. Löwis wrote:
> Why not decoder.PosInf?
Good point. This is fixed in r174 of simplejson.
http://codereview.appspot.com/20095/diff/1/14
File Modules/_json.c (right):
http://codereview.appspot.com/20095/diff/1/14#newcode3
Line 3: #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TYPE)
Python >= 2.6 is the compatibility target, all of those defines could be removed
but they are necessary upstream in simplejson because it supports >= 2.4
On 2009/02/28 09:28:11, Martin v. Löwis wrote:
> Is Python before 2.6 even supported anymore? ISTM that the usage of .format on
> strings outrules Python2.5 and earlier.
Issue 20095: [issue4136] merge json library with latest simplejson 2.0.x
(Closed)
Created 15 years, 10 months ago by Antoine Pitrou
Modified 15 years, 5 months ago
Reviewers: Martin v. Löwis, bob.ippolito
Base URL: http://svn.python.org/view/*checkout*/python/trunk/
Comments: 6