diff -r d0e2437136f5 Doc/library/json.rst --- a/Doc/library/json.rst Sun Jan 19 03:01:23 2014 -0800 +++ b/Doc/library/json.rst Mon Jan 20 12:20:01 2014 +0800 @@ -226,7 +226,9 @@ *parse_float*, if specified, will be called with the string of every JSON float to be decoded. By default, this is equivalent to ``float(num_str)``. This can be used to use another datatype or parser for JSON floats - (e.g. :class:`decimal.Decimal`). + (e.g. :class:`decimal.Decimal`). However, if we give a valid Python float + but an invalid JSON float, such as '.5', the float will be rejected because + JSON parser only accepts a valid JSON float. *parse_int*, if specified, will be called with the string of every JSON int to be decoded. By default, this is equivalent to ``int(num_str)``. This can @@ -312,7 +314,9 @@ *parse_float*, if specified, will be called with the string of every JSON float to be decoded. By default, this is equivalent to ``float(num_str)``. This can be used to use another datatype or parser for JSON floats - (e.g. :class:`decimal.Decimal`). + (e.g. :class:`decimal.Decimal`). However, if we give a valid Python float + but an invalid JSON float, such as '.5', the float will be rejected because + JSON parser only accepts a valid JSON float. *parse_int*, if specified, will be called with the string of every JSON int to be decoded. By default, this is equivalent to ``int(num_str)``. This can diff -r d0e2437136f5 Lib/test/test_json/test_fail.py --- a/Lib/test/test_json/test_fail.py Sun Jan 19 03:01:23 2014 -0800 +++ b/Lib/test/test_json/test_fail.py Mon Jan 20 12:20:01 2014 +0800 @@ -71,6 +71,8 @@ '["mismatch"}', # http://code.google.com/p/simplejson/issues/detail?id=3 '["A\u001FZ control characters in string"]', + # A valid Python number string but an invalid JSON number string + '[.5]', ] SKIPS = {