mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
bpo-17909: Document that json.load can accept a binary IO (GH-7366)
This commit is contained in:
parent
cebe80b59b
commit
bb6366bd75
1 changed files with 7 additions and 3 deletions
|
|
@ -215,9 +215,9 @@ 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:`text file` or
|
||||||
containing a JSON document) to a Python object using this :ref:`conversion
|
:term:`binary file` containing a JSON document) to a Python object using
|
||||||
table <json-to-py-table>`.
|
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
|
||||||
|
|
@ -262,6 +262,10 @@ Basic Usage
|
||||||
.. versionchanged:: 3.6
|
.. versionchanged:: 3.6
|
||||||
All optional parameters are now :ref:`keyword-only <keyword-only_parameter>`.
|
All optional parameters are now :ref:`keyword-only <keyword-only_parameter>`.
|
||||||
|
|
||||||
|
.. versionchanged:: 3.6
|
||||||
|
*fp* can now be a :term:`binary file`. The input encoding should be
|
||||||
|
UTF-8, UTF-16 or UTF-32.
|
||||||
|
|
||||||
.. 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`, :class:`bytes` or :class:`bytearray`
|
Deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue