Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2204)

Issue 20095: [issue4136] merge json library with latest simplejson 2.0.x (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by Antoine Pitrou
Modified:
10 years, 2 months ago
CC:
report_bugs.python.org
Base URL:
http://svn.python.org/view/*checkout*/python/trunk/
Visibility:
Public.

Description

Updated patch from Bob Ippolito, for updating the Python trunk json package to the latest simplejson.

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+2392 lines, -544 lines) Patch
Lib/json/__init__.py View 8 chunks +55 lines, -54 lines 0 comments Download
Lib/json/decoder.py View 10 chunks +144 lines, -127 lines 2 comments Download
Lib/json/encoder.py View 11 chunks +224 lines, -163 lines 2 comments Download
Lib/json/scanner.py View 1 chunk +56 lines, -59 lines 0 comments Download
Lib/json/tests/test_check_circular.py View 1 chunk +30 lines, -0 lines 0 comments Download
Lib/json/tests/test_decode.py View 1 chunk +7 lines, -0 lines 0 comments Download
Lib/json/tests/test_dump.py View 1 chunk +8 lines, -0 lines 0 comments Download
Lib/json/tests/test_encode_basestring_ascii.py View 1 chunk +5 lines, -1 line 0 comments Download
Lib/json/tests/test_fail.py View 1 chunk +1 line, -1 line 0 comments Download
Lib/json/tests/test_float.py View 1 chunk +7 lines, -1 line 0 comments Download
Lib/json/tests/test_unicode.py View 1 chunk +11 lines, -2 lines 0 comments Download
Lib/json/tool.py View 2 chunks +3 lines, -3 lines 0 comments Download
Modules/_json.c View 20 chunks +1841 lines, -133 lines 2 comments Download

Messages

Total messages: 3
Antoine Pitrou
10 years, 7 months ago (2009-02-27 21:54:47 UTC) #1
Martin v. Löwis
The one thing that IMO needs to be decided before this can be accept is ...
10 years, 7 months ago (2009-02-28 09:28:11 UTC) #2
bob.ippolito
10 years, 7 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.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b