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
+.. module:: json.tool
+
+.. _json-commandline:
+
+Command Line Interface
+----------------------
+
+The :mod:`json.tool` module provides a simple command line interface to validate
+and pretty-print JSON objects.
+
+If the optional ``infile`` and ``outfile`` arguments are not
+specified, :attr:`sys.stdin` and :attr:`sys.stdout` will be used respectively::
+
+ $ echo '{"json": "obj"}' | python -m json.tool
+ {
+ "json": "obj"
+ }
+ $ echo '{1.2:3.4}' | python -m json.tool
+ Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
+
+.. versionchanged:: 3.5
+ The output is now in the same order as the input. Use the
+ :option:`--sort-keys` option to sort the output of dictionaries
+ alphabetically by key.
+
+Command line options
+^^^^^^^^^^^^^^^^^^^^
+
+.. cmdoption:: infile
+
+ The JSON file to be validated or pretty-printed::
+
+ $ python -m json.tool mp_films.json
+ [
+ {
+ "title": "And Now for Something Completely Different",
+ "year": 1971
+ },
+ {
+ "title": "Monty Python and the Holy Grail",
+ "year": 1975
+ }
+ ]
+
+ If *infile* is not specified, read from :attr:`sys.stdin`.
+
+.. cmdoption:: outfile
+
+ Write the output of the *infile* to the given *outfile*. Otherwise, write it
+ to :attr:`sys.stdout`.
+
+.. cmdoption:: --sort-keys
+
+ Sort the output of dictionaries alphabetically by key.
+
+ .. versionadded:: 3.5
+
+.. cmdoption:: -h, --help
+
+ Show the help message.
++
+
+ .. 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.