Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6d2bc6e8
Commit
6d2bc6e8
authored
Mar 29, 2013
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#17438: add links to the conversion tables in dump(s)/load(s).
parent
31797e5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
Doc/library/json.rst
Doc/library/json.rst
+12
-5
No files found.
Doc/library/json.rst
View file @
6d2bc6e8
...
@@ -124,7 +124,8 @@ Basic Usage
...
@@ -124,7 +124,8 @@ Basic Usage
sort_keys=False, **kw)
sort_keys=False, **kw)
Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting
Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting
:term:`file-like object`).
:term:`file-like object`) using this :ref:`conversion table
<py-to-json-table>`.
If *skipkeys* is ``True`` (default: ``False``), then dict keys that are not
If *skipkeys* is ``True`` (default: ``False``), then dict keys that are not
of a basic type (:class:`str`, :class:`int`, :class:`float`, :class:`bool`,
of a basic type (:class:`str`, :class:`int`, :class:`float`, :class:`bool`,
...
@@ -183,8 +184,9 @@ Basic Usage
...
@@ -183,8 +184,9 @@ Basic Usage
indent=None, separators=None, default=None, \
indent=None, separators=None, default=None, \
sort_keys=False, **kw)
sort_keys=False, **kw)
Serialize *obj* to a JSON formatted :class:`str`. The arguments have the
Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion
same meaning as in :func:`dump`.
table <py-to-json-table>`. The arguments have the same meaning as in
:func:`dump`.
.. note::
.. note::
...
@@ -204,7 +206,8 @@ Basic Usage
...
@@ -204,7 +206,8 @@ Basic Usage
.. function:: load(fp, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
.. function:: load(fp, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
Deserialize *fp* (a ``.read()``-supporting :term:`file-like object`
Deserialize *fp* (a ``.read()``-supporting :term:`file-like object`
containing a JSON document) to a Python object.
containing a JSON document) to a Python object using this :ref:`conversion
table <json-to-py-table>`.
*object_hook* is an optional function that will be called with the result of
*object_hook* is an optional function that will be called with the result of
any object literal decoded (a :class:`dict`). The return value of
any object literal decoded (a :class:`dict`). The return value of
...
@@ -249,7 +252,7 @@ Basic Usage
...
@@ -249,7 +252,7 @@ Basic Usage
.. function:: loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
.. function:: loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
Deserialize *s* (a :class:`str` instance containing a JSON document) to a
Deserialize *s* (a :class:`str` instance containing a JSON document) to a
Python object.
Python object
using this :ref:`conversion table <json-to-py-table>`
.
The other arguments have the same meaning as in :func:`load`, except
The other arguments have the same meaning as in :func:`load`, except
*encoding* which is ignored and deprecated.
*encoding* which is ignored and deprecated.
...
@@ -264,6 +267,8 @@ Encoders and Decoders
...
@@ -264,6 +267,8 @@ Encoders and Decoders
Performs the following translations in decoding by default:
Performs the following translations in decoding by default:
.. _json-to-py-table:
+---------------+-------------------+
+---------------+-------------------+
| JSON | Python |
| JSON | Python |
+===============+===================+
+===============+===================+
...
@@ -345,6 +350,8 @@ Encoders and Decoders
...
@@ -345,6 +350,8 @@ Encoders and Decoders
Supports the following objects and types by default:
Supports the following objects and types by default:
.. _py-to-json-table:
+-------------------+---------------+
+-------------------+---------------+
| Python | JSON |
| Python | JSON |
+===================+===============+
+===================+===============+
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment