Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
simplejson
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
simplejson
Commits
f9d506602738
Commit
f9d506602738
authored
10 years ago
by
Bob Ippolito
Browse files
Options
Downloads
Patches
Plain Diff
doc updates from
http://bugs.python.org/issue21514
re: #102
parent
e22a95b5284e
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
CHANGES.txt
+5
-0
5 additions, 0 deletions
CHANGES.txt
conf.py
+1
-1
1 addition, 1 deletion
conf.py
index.rst
+75
-15
75 additions, 15 deletions
index.rst
setup.py
+1
-1
1 addition, 1 deletion
setup.py
simplejson/__init__.py
+1
-1
1 addition, 1 deletion
simplejson/__init__.py
with
83 additions
and
18 deletions
CHANGES.txt
+
5
−
0
View file @
f9d50660
Version 3.6.2 released 2014-08-09
* Documentation updates
http://bugs.python.org/issue21514
Version 3.6.1 released 2014-08-09
* Documentation updates
...
...
This diff is collapsed.
Click to expand it.
conf.py
+
1
−
1
View file @
f9d50660
...
...
@@ -44,7 +44,7 @@
# The short X.Y version.
version
=
'
3.6
'
# The full version, including alpha/beta/rc tags.
release
=
'
3.6.
1
'
release
=
'
3.6.
2
'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
...
...
This diff is collapsed.
Click to expand it.
index.rst
+
75
−
15
View file @
f9d50660
...
...
@@ -7,9 +7,11 @@
.. sectionauthor:: Bob Ippolito <bob@redivi.com>
`JSON (JavaScript Object Notation) <http://json.org>`_, specified by
:rfc:`4627`, is a lightweight data interchange format based on a subset of
`JavaScript <http://en.wikipedia.org/wiki/JavaScript>`_ syntax (`ECMA-262 3rd
edition <http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%203rd%20edition,%20December%201999.pdf>`_).
:rfc:`7159` (which obsoletes :rfc:`4627`) and by
`ECMA-404 <http://www.ecma-international.org/publications/standards/Ecma-404.htm>`_,
is a lightweight data interchange format inspired by
`JavaScript <http://en.wikipedia.org/wiki/JavaScript>`_ object literal syntax
(although it is not a strict subset of JavaScript [#rfc-errata]_ ).
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
...
...
@@ -777,6 +779,6 @@
The column corresponding to end (may be ``None``)
Standard Compliance
-------------------
Standard Compliance
and Interoperability
-------------------
---------------------
...
...
@@ -782,9 +784,10 @@
The JSON format is specified by :rfc:`4627`. This section details this
module's level of compliance with the RFC. For simplicity,
:class:`JSONEncoder` and :class:`JSONDecoder` subclasses, and parameters other
than those explicitly mentioned, are not considered.
The JSON format is specified by :rfc:`7159` and by
`ECMA-404 <http://www.ecma-international.org/publications/standards/Ecma-404.htm>`_.
This section details this module's level of compliance with the RFC.
For simplicity, :class:`JSONEncoder` and :class:`JSONDecoder` subclasses, and
parameters other than those explicitly mentioned, are not considered.
This module does not comply with the RFC in a strict fashion, implementing some
extensions that are valid JavaScript but not valid JSON. In particular:
...
...
@@ -787,8 +790,7 @@
This module does not comply with the RFC in a strict fashion, implementing some
extensions that are valid JavaScript but not valid JSON. In particular:
- Top-level non-object, non-array values are accepted and output;
- Infinite and NaN number values are accepted and output;
- Repeated names within an object are accepted, and only the value of the last
name-value pair is used.
...
...
@@ -802,7 +804,7 @@
^^^^^^^^^^^^^^^^^^^
The RFC recommends that JSON be represented using either UTF-8, UTF-16, or
UTF-32, with UTF-8 being the
default
.
UTF-32, with UTF-8 being the
recommended default for maximum interoperability
.
As permitted, though not required, by the RFC, this module's serializer sets
*ensure_ascii=True* by default, thus escaping the output so that the resulting
...
...
@@ -810,6 +812,12 @@
Other than the *ensure_ascii* parameter, this module is defined strictly in
terms of conversion between Python objects and
:class:`Unicode strings <str>`, and thus does not otherwise address the issue
of character encodings.
:class:`Unicode strings <str>`, and thus does not otherwise directly address
the issue of character encodings.
The RFC prohibits adding a byte order mark (BOM) to the start of a JSON text,
and this module's serializer does not add a BOM to its output.
The RFC permits, but does not require, JSON deserializers to ignore an initial
BOM in their input. This module's deserializer will ignore an initial BOM, if
present.
...
...
@@ -815,4 +823,12 @@
.. versionchanged:: 3.6.0
Older versions would raise :exc:`ValueError` when an initial BOM is present
The RFC does not explicitly forbid JSON strings which contain byte sequences
that don't correspond to valid Unicode characters (e.g. unpaired UTF-16
surrogates), but it does note that they may cause interoperability problems.
By default, this module accepts and outputs (when present in the original
:class:`str`) codepoints for such sequences.
Infinite and NaN Number Values
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
...
@@ -841,7 +857,7 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The RFC specifies that the names within a JSON object should be unique, but
does not
specify
how repeated names in JSON objects should be handled. By
does not
mandate
how repeated names in JSON objects should be handled. By
default, this module does not raise an exception; instead, it ignores all but
the last name-value pair for a given name::
...
...
@@ -851,6 +867,42 @@
The *object_pairs_hook* parameter can be used to alter this behavior.
Top-level Non-Object, Non-Array Values
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The old version of JSON specified by the obsolete :rfc:`4627` required that
the top-level value of a JSON text must be either a JSON object or array
(Python :class:`dict` or :class:`list`), and could not be a JSON null,
boolean, number, or string value. :rfc:`7159` removed that restriction, and
this module does not and has never implemented that restriction in either its
serializer or its deserializer.
Regardless, for maximum interoperability, you may wish to voluntarily adhere
to the restriction yourself.
Implementation Limitations
^^^^^^^^^^^^^^^^^^^^^^^^^^
Some JSON deserializer implementations may set limits on:
* the size of accepted JSON texts
* the maximum level of nesting of JSON objects and arrays
* the range and precision of JSON numbers
* the content and maximum length of JSON strings
This module does not impose any such limits beyond those of the relevant
Python datatypes themselves or the Python interpreter itself.
When serializing to JSON, beware any such limitations in applications that may
consume your JSON. In particular, it is common for JSON numbers to be
deserialized into IEEE 754 double precision numbers and thus subject to that
representation's range and precision limitations. This is especially relevant
when serializing Python :class:`int` values of extremely large magnitude, or
when serializing instances of "exotic" numerical types such as
:class:`decimal.Decimal`.
.. highlight:: bash
.. _json-commandline:
...
...
@@ -897,3 +949,11 @@
Write the output of the *infile* to the given *outfile*. Otherwise, write it
to :attr:`sys.stdout`.
.. rubric:: Footnotes
.. [#rfc-errata] As noted in `the errata for RFC 7159
<http://www.rfc-editor.org/errata_search.php?rfc=7159>`_,
JSON permits literal U+2028 (LINE SEPARATOR) and
U+2029 (PARAGRAPH SEPARATOR) characters in strings, whereas JavaScript
(as of ECMAScript Edition 5.1) does not.
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
f9d50660
...
...
@@ -11,7 +11,7 @@
DistutilsPlatformError
IS_PYPY
=
hasattr
(
sys
,
'
pypy_translation_info
'
)
VERSION
=
'
3.6.
1
'
VERSION
=
'
3.6.
2
'
DESCRIPTION
=
"
Simple, fast, extensible JSON encoder/decoder for Python
"
with
open
(
'
README.rst
'
,
'
r
'
)
as
f
:
...
...
This diff is collapsed.
Click to expand it.
simplejson/__init__.py
+
1
−
1
View file @
f9d50660
...
...
@@ -98,7 +98,7 @@
Expecting property name: line 1 column 3 (char 2)
"""
from
__future__
import
absolute_import
__version__
=
'
3.6.
1
'
__version__
=
'
3.6.
2
'
__all__
=
[
'
dump
'
,
'
dumps
'
,
'
load
'
,
'
loads
'
,
'
JSONDecoder
'
,
'
JSONDecodeError
'
,
'
JSONEncoder
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment