diff -r 0e07ab605e0b Doc/library/json.rst --- a/Doc/library/json.rst Sun Dec 15 20:56:00 2013 -0500 +++ b/Doc/library/json.rst Mon Dec 16 18:43:23 2013 +0800 @@ -226,7 +226,10 @@ *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`). Note that this does not mean we can pass + non-valid JSON number string but valid Python number string, such as '.5' + to JSON parser because *parse_float* will be only triggered after the number + string is tokenized. *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 +315,10 @@ *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`). Note that this does not mean we can pass + non-valid JSON number string but valid Python number string, such as '.5' + to JSON parser because *parse_float* will be only triggered after the number + string is tokenized. *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 0e07ab605e0b Lib/test/test_json/test_fail.py --- a/Lib/test/test_json/test_fail.py Sun Dec 15 20:56:00 2013 -0500 +++ b/Lib/test/test_json/test_fail.py Mon Dec 16 18:43:23 2013 +0800 @@ -71,6 +71,8 @@ '["mismatch"}', # http://code.google.com/p/simplejson/issues/detail?id=3 '["A\u001FZ control characters in string"]', + # Valid Python number string but invalid JSON number string + '[.5]', ] SKIPS = {