chunk_id
stringlengths
36
36
source
stringclasses
35 values
source_url
stringlengths
0
290
upstream_license
stringclasses
1 value
document_id
stringlengths
36
36
chunk_index
int64
0
324k
retrieved_at
stringclasses
2 values
chunker_version
stringclasses
4 values
content_hash
stringlengths
15
64
content
stringlengths
50
44.7k
namespace
stringclasses
9 values
source_name
stringclasses
35 values
raw_text
stringlengths
50
44.7k
cleaned_text
stringlengths
50
44.7k
tags
stringclasses
49 values
collection_name
stringclasses
11 values
0947c60b-f950-49ab-a6ef-ef4e0de419f2
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,706
supabase-export-v2
69e63a33d424dbee
A module search path is initialized when Python starts. This module search path may be accessed at :data:`sys.path`. The first entry in the module search path is the directory that contains the input script, if there is one. Otherwise, the first entry is the current directory, which is the case when executing the inter...
trusted_official_docs
CPython Docs
A module search path is initialized when Python starts. This module search path may be accessed at :data:`sys.path`. The first entry in the module search path is the directory that contains the input script, if there is one. Otherwise, the first entry is the current directory, which is the case when executing the inter...
A module search path is initialized when Python starts. This module search path may be accessed at :data:`sys.path`. The first entry in the module search path is the directory that contains the input script, if there is one. Otherwise, the first entry is the current directory, which is the case when executing the inter...
python, official-docs, cpython, P0
Local_Trusted_Corpus
18e19663-bf37-4f43-a1a5-a455a22678e5
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,732
supabase-export-v2
9512ae6049efada5
the shared library name overrides the one based on the executable, which allows paths to be restricted for any program loading the runtime if desired. When the file exists, all registry and environment variables are ignored, isolated mode is enabled, and :mod:`site` is not imported unless one line in the file specifies...
trusted_official_docs
CPython Docs
the shared library name overrides the one based on the executable, which allows paths to be restricted for any program loading the runtime if desired. When the file exists, all registry and environment variables are ignored, isolated mode is enabled, and :mod:`site` is not imported unless one line in the file specifies...
the shared library name overrides the one based on the executable, which allows paths to be restricted for any program loading the runtime if desired. When the file exists, all registry and environment variables are ignored, isolated mode is enabled, and :mod:`site` is not imported unless one line in the file specifies...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3db1f8b5-d756-4c22-9a52-361abcfefc32
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,715
supabase-export-v2
dcefcfe92e9538f0
Once found, ``prefix`` and ``exec_prefix`` are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix` respectively. If :envvar:`PYTHONHOME` is not set, and a ``pyvenv.cfg`` file is found alongside the main executable, or in its parent directory, :data:`sys.prefix` and :data:`sys.exec_prefix` get set to t...
trusted_official_docs
CPython Docs
Once found, ``prefix`` and ``exec_prefix`` are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix` respectively. If :envvar:`PYTHONHOME` is not set, and a ``pyvenv.cfg`` file is found alongside the main executable, or in its parent directory, :data:`sys.prefix` and :data:`sys.exec_prefix` get set to t...
Once found, ``prefix`` and ``exec_prefix`` are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix` respectively. If :envvar:`PYTHONHOME` is not set, and a ``pyvenv.cfg`` file is found alongside the main executable, or in its parent directory, :data:`sys.prefix` and :data:`sys.exec_prefix` get set to t...
python, official-docs, cpython, P0
Local_Trusted_Corpus
40118861-5a8a-41a1-8c7d-9b1bd23bea6f
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,725
supabase-export-v2
f9dbb3531e940ab5
The ``prefix`` and ``exec_prefix`` values of the base installation are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`. As well as being used as a marker to identify virtual environments, ``pyvenv.cfg`` may also be used to configure the :mod:`site` initialization. Please refer to :mod:`site`'s :re...
trusted_official_docs
CPython Docs
The ``prefix`` and ``exec_prefix`` values of the base installation are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`. As well as being used as a marker to identify virtual environments, ``pyvenv.cfg`` may also be used to configure the :mod:`site` initialization. Please refer to :mod:`site`'s :re...
The ``prefix`` and ``exec_prefix`` values of the base installation are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`. As well as being used as a marker to identify virtual environments, ``pyvenv.cfg`` may also be used to configure the :mod:`site` initialization. Please refer to :mod:`site`'s :re...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6f76424b-4ea8-4163-9576-7a13af5aead9
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,724
supabase-export-v2
27e8ea2e3284ef0e
Virtual environments place a ``pyvenv.cfg`` file in their prefix, which causes :data:`sys.prefix` and :data:`sys.exec_prefix` to point to them, instead of the base installation. The ``prefix`` and ``exec_prefix`` values of the base installation are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`.
trusted_official_docs
CPython Docs
Virtual environments place a ``pyvenv.cfg`` file in their prefix, which causes :data:`sys.prefix` and :data:`sys.exec_prefix` to point to them, instead of the base installation. The ``prefix`` and ``exec_prefix`` values of the base installation are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`.
Virtual environments place a ``pyvenv.cfg`` file in their prefix, which causes :data:`sys.prefix` and :data:`sys.exec_prefix` to point to them, instead of the base installation. The ``prefix`` and ``exec_prefix`` values of the base installation are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8ccbc085-1f09-498f-9bf4-e0217ec7e8c8
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,733
supabase-export-v2
631486350afb785f
be absolute or relative to the location of the file. Import statements other than to ``site`` are not permitted, and arbitrary code cannot be specified. Note that ``.pth`` files (without leading underscore) will be processed normally by the :mod:`site` module when ``import site`` has been specified.
trusted_official_docs
CPython Docs
be absolute or relative to the location of the file. Import statements other than to ``site`` are not permitted, and arbitrary code cannot be specified. Note that ``.pth`` files (without leading underscore) will be processed normally by the :mod:`site` module when ``import site`` has been specified.
be absolute or relative to the location of the file. Import statements other than to ``site`` are not permitted, and arbitrary code cannot be specified. Note that ``.pth`` files (without leading underscore) will be processed normally by the :mod:`site` module when ``import site`` has been specified.
python, official-docs, cpython, P0
Local_Trusted_Corpus
a55c3a61-2982-4d72-a58c-fbc24c162754
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,731
supabase-export-v2
b8ee4ec960376694
_pth files ---------- To completely override :data:`sys.path` create a ``._pth`` file with the same name as the shared library or executable (``python._pth`` or ``python311._pth``). The shared library path is always known on Windows, however it may not be available on other platforms. In the ``._pth`` file specify one ...
trusted_official_docs
CPython Docs
_pth files ---------- To completely override :data:`sys.path` create a ``._pth`` file with the same name as the shared library or executable (``python._pth`` or ``python311._pth``). The shared library path is always known on Windows, however it may not be available on other platforms. In the ``._pth`` file specify one ...
_pth files ---------- To completely override :data:`sys.path` create a ``._pth`` file with the same name as the shared library or executable (``python._pth`` or ``python311._pth``). The shared library path is always known on Windows, however it may not be available on other platforms. In the ``._pth`` file specify one ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
ae13e6c4-0209-4c39-a9a2-53fd44d233c3
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,709
supabase-export-v2
f365125c8b573f28
.. note:: :envvar:`PYTHONPATH` will affect all installed Python versions/environments. Be wary of setting this in your shell profile or global environment variables. The :mod:`site` module offers more nuanced techniques as mentioned below.
trusted_official_docs
CPython Docs
.. note:: :envvar:`PYTHONPATH` will affect all installed Python versions/environments. Be wary of setting this in your shell profile or global environment variables. The :mod:`site` module offers more nuanced techniques as mentioned below.
.. note:: :envvar:`PYTHONPATH` will affect all installed Python versions/environments. Be wary of setting this in your shell profile or global environment variables. The :mod:`site` module offers more nuanced techniques as mentioned below.
python, official-docs, cpython, P0
Local_Trusted_Corpus
b545ab35-ba09-45d7-8066-3f15ddbef2ff
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,713
supabase-export-v2
15bda9c2112e4d1b
(``lib/python3.11/os.py``). On Windows ``prefix`` and ``exec_prefix`` are the same, however on other platforms :file:`lib/python{majorversion}.{minorversion}/lib-dynload` (``lib/python3.11/lib-dynload``) is searched for and used as an anchor for ``exec_prefix``. On some platforms :file:`lib` may be :file:`lib64` or ano...
trusted_official_docs
CPython Docs
(``lib/python3.11/os.py``). On Windows ``prefix`` and ``exec_prefix`` are the same, however on other platforms :file:`lib/python{majorversion}.{minorversion}/lib-dynload` (``lib/python3.11/lib-dynload``) is searched for and used as an anchor for ``exec_prefix``. On some platforms :file:`lib` may be :file:`lib64` or ano...
(``lib/python3.11/os.py``). On Windows ``prefix`` and ``exec_prefix`` are the same, however on other platforms :file:`lib/python{majorversion}.{minorversion}/lib-dynload` (``lib/python3.11/lib-dynload``) is searched for and used as an anchor for ``exec_prefix``. On some platforms :file:`lib` may be :file:`lib64` or ano...
python, official-docs, cpython, P0
Local_Trusted_Corpus
b90502b1-993c-44f8-a6d0-25b5da2363f6
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,712
supabase-export-v2
de96c0753f703d2e
any symbolic links are followed so the real Python executable location is used as the search starting point. The Python executable location is called ``home``. Once ``home`` is determined, the ``prefix`` directory is found by first looking for :file:`python{majorversion}{minorversion}.zip` (``python311.zip``). On Windo...
trusted_official_docs
CPython Docs
any symbolic links are followed so the real Python executable location is used as the search starting point. The Python executable location is called ``home``. Once ``home`` is determined, the ``prefix`` directory is found by first looking for :file:`python{majorversion}{minorversion}.zip` (``python311.zip``). On Windo...
any symbolic links are followed so the real Python executable location is used as the search starting point. The Python executable location is called ``home``. Once ``home`` is determined, the ``prefix`` directory is found by first looking for :file:`python{majorversion}{minorversion}.zip` (``python311.zip``). On Windo...
python, official-docs, cpython, P0
Local_Trusted_Corpus
c6cead34-c684-4c5c-9dc7-f6b7173512f2
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,716
supabase-export-v2
1ab7097329800a5c
get set to the directory containing ``pyvenv.cfg``, otherwise they are set to the same value as :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`, respectively. This is used by :ref:`sys-path-init-virtual-environments`. Finally, the :mod:`site` module is processed and :file:`site-packages` directories are added ...
trusted_official_docs
CPython Docs
get set to the directory containing ``pyvenv.cfg``, otherwise they are set to the same value as :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`, respectively. This is used by :ref:`sys-path-init-virtual-environments`. Finally, the :mod:`site` module is processed and :file:`site-packages` directories are added ...
get set to the directory containing ``pyvenv.cfg``, otherwise they are set to the same value as :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`, respectively. This is used by :ref:`sys-path-init-virtual-environments`. Finally, the :mod:`site` module is processed and :file:`site-packages` directories are added ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
d17daeb7-4ac4-40b4-a647-3cdbf91613c2
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,707
supabase-export-v2
0c59b2e1d45f5c86
is one. Otherwise, the first entry is the current directory, which is the case when executing the interactive shell, a :option:`-c` command, or :option:`-m` module. The :envvar:`PYTHONPATH` environment variable is often used to add directories to the search path. If this environment variable is found then the contents ...
trusted_official_docs
CPython Docs
is one. Otherwise, the first entry is the current directory, which is the case when executing the interactive shell, a :option:`-c` command, or :option:`-m` module. The :envvar:`PYTHONPATH` environment variable is often used to add directories to the search path. If this environment variable is found then the contents ...
is one. Otherwise, the first entry is the current directory, which is the case when executing the interactive shell, a :option:`-c` command, or :option:`-m` module. The :envvar:`PYTHONPATH` environment variable is often used to add directories to the search path. If this environment variable is found then the contents ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
dc91ed14-f20c-417e-ac1f-8acb679cd64a
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,710
supabase-export-v2
d0448b1caeda7c30
Python versions/environments. Be wary of setting this in your shell profile or global environment variables. The :mod:`site` module offers more nuanced techniques as mentioned below. The next items added are the directories containing standard Python modules as well as any :term:`extension module`\s that these modules ...
trusted_official_docs
CPython Docs
Python versions/environments. Be wary of setting this in your shell profile or global environment variables. The :mod:`site` module offers more nuanced techniques as mentioned below. The next items added are the directories containing standard Python modules as well as any :term:`extension module`\s that these modules ...
Python versions/environments. Be wary of setting this in your shell profile or global environment variables. The :mod:`site` module offers more nuanced techniques as mentioned below. The next items added are the directories containing standard Python modules as well as any :term:`extension module`\s that these modules ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e1c0d654-984c-4541-86f0-1810d3e7433c
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,729
supabase-export-v2
7800334711a35de9
.. note:: There are other ways "virtual environments" could be implemented. This documentation refers to implementations based on the ``pyvenv.cfg`` mechanism, such as :mod:`venv`, that many virtual environment implementations follow.
trusted_official_docs
CPython Docs
.. note:: There are other ways "virtual environments" could be implemented. This documentation refers to implementations based on the ``pyvenv.cfg`` mechanism, such as :mod:`venv`, that many virtual environment implementations follow.
.. note:: There are other ways "virtual environments" could be implemented. This documentation refers to implementations based on the ``pyvenv.cfg`` mechanism, such as :mod:`venv`, that many virtual environment implementations follow.
python, official-docs, cpython, P0
Local_Trusted_Corpus
eb43e3fd-e72a-4ec6-99b7-d2e630045a03
CPython Docs
file://datasets/cpython/Doc/library/sys_path_init.rst
unknown
413dbb5b-636d-4b85-b238-62f1fa5889ee
2,711
supabase-export-v2
b0f9fe16d8100e20
and ``.so`` files on other platforms. The directory with the platform-independent Python modules is called ``prefix``. The directory with the extension modules is called ``exec_prefix``. The :envvar:`PYTHONHOME` environment variable may be used to set the ``prefix`` and ``exec_prefix`` locations. Otherwise these direct...
trusted_official_docs
CPython Docs
and ``.so`` files on other platforms. The directory with the platform-independent Python modules is called ``prefix``. The directory with the extension modules is called ``exec_prefix``. The :envvar:`PYTHONHOME` environment variable may be used to set the ``prefix`` and ``exec_prefix`` locations. Otherwise these direct...
and ``.so`` files on other platforms. The directory with the platform-independent Python modules is called ``prefix``. The directory with the extension modules is called ``exec_prefix``. The :envvar:`PYTHONHOME` environment variable may be used to set the ``prefix`` and ``exec_prefix`` locations. Otherwise these direct...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0011cefd-2a09-4d54-839c-6df81cdc6915
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,888
supabase-export-v2
8459fb47e17021cc
note that they may cause interoperability problems. By default, this module accepts and outputs (when present in the original :class:`str`) code points for such sequences. Infinite and NaN Number Values ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
trusted_official_docs
CPython Docs
note that they may cause interoperability problems. By default, this module accepts and outputs (when present in the original :class:`str`) code points for such sequences. Infinite and NaN Number Values ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note that they may cause interoperability problems. By default, this module accepts and outputs (when present in the original :class:`str`) code points for such sequences. Infinite and NaN Number Values ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
python, official-docs, cpython, P0
Local_Trusted_Corpus
00d8d9ec-2175-4ad3-ab2d-4a5a0e803ab4
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,818
supabase-export-v2
b30df04bbf977c04
.. _json-to-py-table: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | str | +---------------+-------------------+ | number (int) | int | +----...
trusted_official_docs
CPython Docs
.. _json-to-py-table: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | str | +---------------+-------------------+ | number (int) | int | +----...
.. _json-to-py-table: +---------------+-------------------+ | JSON | Python | +===============+===================+ | object | dict | +---------------+-------------------+ | array | list | +---------------+-------------------+ | string | str | +---------------+-------------------+ | number (int) | int | +----...
python, official-docs, cpython, P0
Local_Trusted_Corpus
011d7047-124f-4547-a1b7-85efe0a1a0e2
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,757
supabase-export-v2
c13ca4b97d17ac34
Customizing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> import decimal >>> json.loads('1.1', pars...
trusted_official_docs
CPython Docs
Customizing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> import decimal >>> json.loads('1.1', pars...
Customizing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> import decimal >>> json.loads('1.1', pars...
python, official-docs, cpython, P0
Local_Trusted_Corpus
045f7a56-34a3-4b82-b016-9928c48eb05f
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,791
supabase-export-v2
9f94d0a0732ea6d8
JSON and then back into a dictionary, the dictionary may not equal the original one. That is, ``loads(dumps(x)) != x`` if x has non-string keys. .. function:: load(fp, *, cls=None, object_hook=None, parse_float=None, \ parse_int=None, parse_constant=None, \ object_pairs_hook=None, array_hook=None, **kw)
trusted_official_docs
CPython Docs
JSON and then back into a dictionary, the dictionary may not equal the original one. That is, ``loads(dumps(x)) != x`` if x has non-string keys. .. function:: load(fp, *, cls=None, object_hook=None, parse_float=None, \ parse_int=None, parse_constant=None, \ object_pairs_hook=None, array_hook=None, **kw)
JSON and then back into a dictionary, the dictionary may not equal the original one. That is, ``loads(dumps(x)) != x`` if x has non-string keys. .. function:: load(fp, *, cls=None, object_hook=None, parse_float=None, \ parse_int=None, parse_constant=None, \ object_pairs_hook=None, array_hook=None, **kw)
python, official-docs, cpython, P0
Local_Trusted_Corpus
052a5814-7ceb-4002-afea-a5d183352593
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,772
supabase-export-v2
eb180e5f09447780
.. note:: Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so trying to serialize multiple objects with repeated calls to :func:`dump` using the same *fp* will result in an invalid JSON file.
trusted_official_docs
CPython Docs
.. note:: Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so trying to serialize multiple objects with repeated calls to :func:`dump` using the same *fp* will result in an invalid JSON file.
.. note:: Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so trying to serialize multiple objects with repeated calls to :func:`dump` using the same *fp* will result in an invalid JSON file.
python, official-docs, cpython, P0
Local_Trusted_Corpus
05a622d1-ae2c-48e0-82ac-54dc847c9854
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,799
supabase-export-v2
d400f9415ad7754a
default), it is equivalent to ``float(num_str)``. This can be used to parse JSON floats into custom datatypes, for example :class:`decimal.Decimal`. :type parse_float: :term:`callable` | None :param parse_int: If set, a function that is called with the string of every JSON int to be decoded. If ``None`` (the default)...
trusted_official_docs
CPython Docs
default), it is equivalent to ``float(num_str)``. This can be used to parse JSON floats into custom datatypes, for example :class:`decimal.Decimal`. :type parse_float: :term:`callable` | None :param parse_int: If set, a function that is called with the string of every JSON int to be decoded. If ``None`` (the default)...
default), it is equivalent to ``float(num_str)``. This can be used to parse JSON floats into custom datatypes, for example :class:`decimal.Decimal`. :type parse_float: :term:`callable` | None :param parse_int: If set, a function that is called with the string of every JSON int to be decoded. If ``None`` (the default)...
python, official-docs, cpython, P0
Local_Trusted_Corpus
06cc280f-e22f-452f-bdbc-b3069e7554d3
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,893
supabase-export-v2
0995e433790bff64
Repeated Names Within an Object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The RFC specifies that the names within a JSON object should be unique, but 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...
trusted_official_docs
CPython Docs
Repeated Names Within an Object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The RFC specifies that the names within a JSON object should be unique, but 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...
Repeated Names Within an Object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The RFC specifies that the names within a JSON object should be unique, but 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...
python, official-docs, cpython, P0
Local_Trusted_Corpus
09d4135c-5435-42b6-81b3-90984c7d07ad
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,841
supabase-export-v2
96bddc51a41347f0
.. _py-to-json-table: +----------------------------------------+---------------+ | Python | JSON | +========================================+===============+ | dict | object | +----------------------------------------+---------------+ | list, tuple | array | +----------------------------------------+-------------...
trusted_official_docs
CPython Docs
.. _py-to-json-table: +----------------------------------------+---------------+ | Python | JSON | +========================================+===============+ | dict | object | +----------------------------------------+---------------+ | list, tuple | array | +----------------------------------------+-------------...
.. _py-to-json-table: +----------------------------------------+---------------+ | Python | JSON | +========================================+===============+ | dict | object | +----------------------------------------+---------------+ | list, tuple | array | +----------------------------------------+-------------...
python, official-docs, cpython, P0
Local_Trusted_Corpus
14346989-dc45-4c8f-b40f-2110538b56d7
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,745
supabase-export-v2
7a938e6eae1556cb
A malicious JSON string may cause the decoder to consume considerable CPU and memory resources. Limiting the size of data to be parsed is recommended. This module exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules.
trusted_official_docs
CPython Docs
A malicious JSON string may cause the decoder to consume considerable CPU and memory resources. Limiting the size of data to be parsed is recommended. This module exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules.
A malicious JSON string may cause the decoder to consume considerable CPU and memory resources. Limiting the size of data to be parsed is recommended. This module exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules.
python, official-docs, cpython, P0
Local_Trusted_Corpus
14c25062-5371-4d61-93e7-a49bac4246cc
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,819
supabase-export-v2
7acfcb60fc46b7a3
| number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float...
trusted_official_docs
CPython Docs
| number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float...
| number (real) | float | +---------------+-------------------+ | true | True | +---------------+-------------------+ | false | False | +---------------+-------------------+ | null | None | +---------------+-------------------+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1897a1a1-0fa1-4fde-8824-2b53f4c156ce
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,774
supabase-export-v2
3a808fa51599e31c
:param object obj: The Python object to be serialized. :param fp: The file-like object *obj* will be serialized to. The :mod:`!json` module always produces :class:`str` objects, not :class:`bytes` objects, therefore ``fp.write()`` must support :class:`str` input. :type fp: :term:`file-like object`
trusted_official_docs
CPython Docs
:param object obj: The Python object to be serialized. :param fp: The file-like object *obj* will be serialized to. The :mod:`!json` module always produces :class:`str` objects, not :class:`bytes` objects, therefore ``fp.write()`` must support :class:`str` input. :type fp: :term:`file-like object`
:param object obj: The Python object to be serialized. :param fp: The file-like object *obj* will be serialized to. The :mod:`!json` module always produces :class:`str` objects, not :class:`bytes` objects, therefore ``fp.write()`` must support :class:`str` input. :type fp: :term:`file-like object`
python, official-docs, cpython, P0
Local_Trusted_Corpus
18d3ee52-1bcc-4eb0-9313-5d0e5822a3d4
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,858
supabase-export-v2
3707b69be51507a4
For example, to support arbitrary iterators, you could implement :meth:`~JSONEncoder.default` like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return super().default(o)
trusted_official_docs
CPython Docs
For example, to support arbitrary iterators, you could implement :meth:`~JSONEncoder.default` like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return super().default(o)
For example, to support arbitrary iterators, you could implement :meth:`~JSONEncoder.default` like this:: def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return super().default(o)
python, official-docs, cpython, P0
Local_Trusted_Corpus
19359b4b-4d3b-4d33-a503-5c233958ceea
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,853
supabase-export-v2
837e8aef427b15d3
.. versionchanged:: 3.4 Use ``(',', ': ')`` as default if *indent* is not ``None``. If specified, *default* should be a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a :exc:`TypeError`. If not specified, :exc:`TypeError` is ...
trusted_official_docs
CPython Docs
.. versionchanged:: 3.4 Use ``(',', ': ')`` as default if *indent* is not ``None``. If specified, *default* should be a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a :exc:`TypeError`. If not specified, :exc:`TypeError` is ...
.. versionchanged:: 3.4 Use ``(',', ': ')`` as default if *indent* is not ``None``. If specified, *default* should be a function that gets called for objects that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a :exc:`TypeError`. If not specified, :exc:`TypeError` is ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1c536df6-a874-4e1c-b8a1-e4a072dde3fd
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,846
supabase-export-v2
602f542f440de299
all characters will be output as-is, except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters U+0000 through U+001F. If *check_circular* is true (the default), then lists, dicts, and custom encoded objects will be checked for circular references during encoding to pr...
trusted_official_docs
CPython Docs
all characters will be output as-is, except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters U+0000 through U+001F. If *check_circular* is true (the default), then lists, dicts, and custom encoded objects will be checked for circular references during encoding to pr...
all characters will be output as-is, except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters U+0000 through U+001F. If *check_circular* is true (the default), then lists, dicts, and custom encoded objects will be checked for circular references during encoding to pr...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1cf2196d-a602-4ffc-abca-cef11e7f1aa2
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,765
supabase-export-v2
56795bbb7e98c0bd
.. note:: JSON is a subset of `YAML <https://yaml.org/>`_ 1.2. The JSON produced by this module's default settings (in particular, the default *separators* value) is also a subset of YAML 1.0 and 1.1. This module can thus also be used as a YAML serializer.
trusted_official_docs
CPython Docs
.. note:: JSON is a subset of `YAML <https://yaml.org/>`_ 1.2. The JSON produced by this module's default settings (in particular, the default *separators* value) is also a subset of YAML 1.0 and 1.1. This module can thus also be used as a YAML serializer.
.. note:: JSON is a subset of `YAML <https://yaml.org/>`_ 1.2. The JSON produced by this module's default settings (in particular, the default *separators* value) is also a subset of YAML 1.0 and 1.1. This module can thus also be used as a YAML serializer.
python, official-docs, cpython, P0
Local_Trusted_Corpus
1d20bca9-a7fd-48cd-b098-d080aa535d57
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,934
supabase-export-v2
8d592cbfe400011e
.. rubric:: Footnotes .. [#rfc-errata] As noted in `the errata for RFC 7159 <https://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.
trusted_official_docs
CPython Docs
.. rubric:: Footnotes .. [#rfc-errata] As noted in `the errata for RFC 7159 <https://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.
.. rubric:: Footnotes .. [#rfc-errata] As noted in `the errata for RFC 7159 <https://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.
python, official-docs, cpython, P0
Local_Trusted_Corpus
287c748e-eb69-453b-8fdf-28e02171c245
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,904
supabase-export-v2
2d88f5ef18b0c735
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`. .. _json-commandline: .. program:: json
trusted_official_docs
CPython Docs
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`. .. _json-commandline: .. program:: json
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`. .. _json-commandline: .. program:: json
python, official-docs, cpython, P0
Local_Trusted_Corpus
28820e53-2c00-4cdd-8f31-dda154f2c436
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,801
supabase-export-v2
ce861039b7d44d21
``'-Infinity'``, ``'Infinity'``, or ``'NaN'``. This can be used to raise an exception if invalid JSON numbers are encountered. Default ``None``. :type parse_constant: :term:`callable` | None :raises JSONDecodeError: When the data being deserialized is not a valid JSON document.
trusted_official_docs
CPython Docs
``'-Infinity'``, ``'Infinity'``, or ``'NaN'``. This can be used to raise an exception if invalid JSON numbers are encountered. Default ``None``. :type parse_constant: :term:`callable` | None :raises JSONDecodeError: When the data being deserialized is not a valid JSON document.
``'-Infinity'``, ``'Infinity'``, or ``'NaN'``. This can be used to raise an exception if invalid JSON numbers are encountered. Default ``None``. :type parse_constant: :term:`callable` | None :raises JSONDecodeError: When the data being deserialized is not a valid JSON document.
python, official-docs, cpython, P0
Local_Trusted_Corpus
28dac1f6-333f-4c58-9ae9-955b409176d4
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,835
supabase-export-v2
941929640507b882
.. method:: raw_decode(s) Decode a JSON document from *s* (a :class:`str` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in *s* where the document ended.
trusted_official_docs
CPython Docs
.. method:: raw_decode(s) Decode a JSON document from *s* (a :class:`str` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in *s* where the document ended.
.. method:: raw_decode(s) Decode a JSON document from *s* (a :class:`str` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in *s* where the document ended.
python, official-docs, cpython, P0
Local_Trusted_Corpus
2b777b60-82e2-4b41-95a7-9afc5fca1ecb
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,898
supabase-export-v2
4c2ab5b90bcb2ad3
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.
trusted_official_docs
CPython Docs
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.
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.
python, official-docs, cpython, P0
Local_Trusted_Corpus
3365c388-cdf4-483c-89bf-7509acca1fe2
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,820
supabase-export-v2
b50d8c2ee88dcdaa
It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. *object_hook* is an optional function that will be called with the result of every JSON object decoded and its return value will be used in place of the given :class:`dict`. This can b...
trusted_official_docs
CPython Docs
It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. *object_hook* is an optional function that will be called with the result of every JSON object decoded and its return value will be used in place of the given :class:`dict`. This can b...
It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. *object_hook* is an optional function that will be called with the result of every JSON object decoded and its return value will be used in place of the given :class:`dict`. This can b...
python, official-docs, cpython, P0
Local_Trusted_Corpus
33a66e2f-56df-4e39-b35f-6cec1bcaebb0
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,790
supabase-export-v2
96843963dc19d316
.. note:: Keys in key/value pairs of JSON are always of the type :class:`str`. When a dictionary is converted into JSON, all the keys of the dictionary are coerced to strings. As a result of this, if a dictionary is converted into JSON and then back into a dictionary, the dictionary may not equal the original one. ...
trusted_official_docs
CPython Docs
.. note:: Keys in key/value pairs of JSON are always of the type :class:`str`. When a dictionary is converted into JSON, all the keys of the dictionary are coerced to strings. As a result of this, if a dictionary is converted into JSON and then back into a dictionary, the dictionary may not equal the original one. ...
.. note:: Keys in key/value pairs of JSON are always of the type :class:`str`. When a dictionary is converted into JSON, all the keys of the dictionary are coerced to strings. As a result of this, if a dictionary is converted into JSON and then back into a dictionary, the dictionary may not equal the original one. ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
34a3ab5e-b576-4b28-ac69-0333cb5c015e
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,742
supabase-export-v2
69599f53a67feb55
-------------- `JSON (JavaScript Object Notation) <https://json.org>`_, specified by :rfc:`7159` (which obsoletes :rfc:`4627`) and by `ECMA-404 <https://ecma-international.org/publications-and-standards/standards/ecma-404/>`_, is a lightweight data interchange format inspired by `JavaScript <https://en.wikipedia.org/wi...
trusted_official_docs
CPython Docs
-------------- `JSON (JavaScript Object Notation) <https://json.org>`_, specified by :rfc:`7159` (which obsoletes :rfc:`4627`) and by `ECMA-404 <https://ecma-international.org/publications-and-standards/standards/ecma-404/>`_, is a lightweight data interchange format inspired by `JavaScript <https://en.wikipedia.org/wi...
-------------- `JSON (JavaScript Object Notation) <https://json.org>`_, specified by :rfc:`7159` (which obsoletes :rfc:`4627`) and by `ECMA-404 <https://ecma-international.org/publications-and-standards/standards/ecma-404/>`_, is a lightweight data interchange format inspired by `JavaScript <https://en.wikipedia.org/wi...
python, official-docs, cpython, P0
Local_Trusted_Corpus
41641ca3-fe62-46b5-93e5-0fb135a622dd
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,851
supabase-export-v2
0035088797dfe6ce
.. versionchanged:: 3.2 Allow strings for *indent* in addition to integers. If specified, *separators* should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',',...
trusted_official_docs
CPython Docs
.. versionchanged:: 3.2 Allow strings for *indent* in addition to integers. If specified, *separators* should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',',...
.. versionchanged:: 3.2 Allow strings for *indent* in addition to integers. If specified, *separators* should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',',...
python, official-docs, cpython, P0
Local_Trusted_Corpus
41b2c5b1-2d06-4ddd-a403-4c7559a24b46
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,808
supabase-export-v2
13e7e5f825e1c518
now limits the maximum length of the integer string via the interpreter's :ref:`integer string conversion length limitation <int_max_str_digits>` to help avoid denial of service attacks. .. versionchanged:: 3.15 Added the optional *array_hook* parameter.
trusted_official_docs
CPython Docs
now limits the maximum length of the integer string via the interpreter's :ref:`integer string conversion length limitation <int_max_str_digits>` to help avoid denial of service attacks. .. versionchanged:: 3.15 Added the optional *array_hook* parameter.
now limits the maximum length of the integer string via the interpreter's :ref:`integer string conversion length limitation <int_max_str_digits>` to help avoid denial of service attacks. .. versionchanged:: 3.15 Added the optional *array_hook* parameter.
python, official-docs, cpython, P0
Local_Trusted_Corpus
43213411-c1ff-40d2-94ba-2358ea062b75
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,920
supabase-export-v2
74fbb37f0b17cb8a
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 :data:`sys.stdin`.
trusted_official_docs
CPython Docs
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 :data:`sys.stdin`.
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 :data:`sys.stdin`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
447c669f-6114-4775-aeb8-d2fe1717ce12
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,810
supabase-export-v2
4c2879dfe9e2d9ab
.. function:: loads(s, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, array_hook=None, **kw) Identical to :func:`load`, but instead of a file-like object, deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance containing a JSON doc...
trusted_official_docs
CPython Docs
.. function:: loads(s, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, array_hook=None, **kw) Identical to :func:`load`, but instead of a file-like object, deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance containing a JSON doc...
.. function:: loads(s, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, array_hook=None, **kw) Identical to :func:`load`, but instead of a file-like object, deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance containing a JSON doc...
python, official-docs, cpython, P0
Local_Trusted_Corpus
44ec5b25-df45-4a88-b334-13ec9d953824
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,847
supabase-export-v2
21e0f17fc9d2982f
objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause a :exc:`RecursionError`). Otherwise, no such check takes place. If *allow_nan* is true (the default), then ``NaN``, ``Infinity``, and ``-Infinity`` will be encoded as such. This behavior is not JSON spe...
trusted_official_docs
CPython Docs
objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause a :exc:`RecursionError`). Otherwise, no such check takes place. If *allow_nan* is true (the default), then ``NaN``, ``Infinity``, and ``-Infinity`` will be encoded as such. This behavior is not JSON spe...
objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause a :exc:`RecursionError`). Otherwise, no such check takes place. If *allow_nan* is true (the default), then ``NaN``, ``Infinity``, and ``-Infinity`` will be encoded as such. This behavior is not JSON spe...
python, official-docs, cpython, P0
Local_Trusted_Corpus
473f87a4-82de-4525-b65e-753db18671e0
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,744
supabase-export-v2
4b47b973b2b8585f
be ambiguous. All values in Python are objects. In JSON, an object refers to any data wrapped in curly braces, similar to a Python dictionary. .. warning:: Be cautious when parsing JSON data from untrusted sources. A malicious JSON string may cause the decoder to consume considerable CPU and memory resources. Limiti...
trusted_official_docs
CPython Docs
be ambiguous. All values in Python are objects. In JSON, an object refers to any data wrapped in curly braces, similar to a Python dictionary. .. warning:: Be cautious when parsing JSON data from untrusted sources. A malicious JSON string may cause the decoder to consume considerable CPU and memory resources. Limiti...
be ambiguous. All values in Python are objects. In JSON, an object refers to any data wrapped in curly braces, similar to a Python dictionary. .. warning:: Be cautious when parsing JSON data from untrusted sources. A malicious JSON string may cause the decoder to consume considerable CPU and memory resources. Limiti...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4afde2e3-6902-477c-aea7-43a732b18fad
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,755
supabase-export-v2
c7117b6d333b030b
Decoding JSON:: >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('"\\"foo\\bar"') '"foo\x08ar' >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io) ['streaming API']
trusted_official_docs
CPython Docs
Decoding JSON:: >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('"\\"foo\\bar"') '"foo\x08ar' >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io) ['streaming API']
Decoding JSON:: >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('"\\"foo\\bar"') '"foo\x08ar' >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io) ['streaming API']
python, official-docs, cpython, P0
Local_Trusted_Corpus
4f5d23f1-9f15-4a4f-93f9-d0c090542db7
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,845
supabase-export-v2
299d8fabbbece20f
be raised when trying to encode keys that are not :class:`str`, :class:`int`, :class:`float`, :class:`bool` or ``None``. If *skipkeys* is true, such items are simply skipped. If *ensure_ascii* is true (the default), the output is guaranteed to have all incoming non-ASCII and non-printable characters escaped. If *ensur...
trusted_official_docs
CPython Docs
be raised when trying to encode keys that are not :class:`str`, :class:`int`, :class:`float`, :class:`bool` or ``None``. If *skipkeys* is true, such items are simply skipped. If *ensure_ascii* is true (the default), the output is guaranteed to have all incoming non-ASCII and non-printable characters escaped. If *ensur...
be raised when trying to encode keys that are not :class:`str`, :class:`int`, :class:`float`, :class:`bool` or ``None``. If *skipkeys* is true, such items are simply skipped. If *ensure_ascii* is true (the default), the output is guaranteed to have all incoming non-ASCII and non-printable characters escaped. If *ensur...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4ffe7650-fe51-44e5-8eb9-16b27b8e7379
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,887
supabase-export-v2
38f654ad257a014a
does not require, JSON deserializers to ignore an initial BOM in their input. This module's deserializer raises a :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 surroga...
trusted_official_docs
CPython Docs
does not require, JSON deserializers to ignore an initial BOM in their input. This module's deserializer raises a :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 surroga...
does not require, JSON deserializers to ignore an initial BOM in their input. This module's deserializer raises a :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 surroga...
python, official-docs, cpython, P0
Local_Trusted_Corpus
502674b5-f4d2-444f-ad07-b8a7f2ef5c48
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,811
supabase-export-v2
c06870e23102afe0
of a file-like object, deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance containing a JSON document) to a Python object using this :ref:`conversion table <json-to-py-table>`. .. versionchanged:: 3.6 *s* can now be of type :class:`bytes` or :class:`bytearray`. The input encoding should be ...
trusted_official_docs
CPython Docs
of a file-like object, deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance containing a JSON document) to a Python object using this :ref:`conversion table <json-to-py-table>`. .. versionchanged:: 3.6 *s* can now be of type :class:`bytes` or :class:`bytearray`. The input encoding should be ...
of a file-like object, deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance containing a JSON document) to a Python object using this :ref:`conversion table <json-to-py-table>`. .. versionchanged:: 3.6 *s* can now be of type :class:`bytes` or :class:`bytearray`. The input encoding should be ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
53e0d7d4-16f7-4c49-a131-b036ef84247c
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,794
supabase-export-v2
59258172b63ace6f
:param fp: A ``.read()``-supporting :term:`text file` or :term:`binary file` containing the JSON document to be deserialized. :type fp: :term:`file-like object` :param cls: If set, a custom JSON decoder. Additional keyword arguments to :func:`!load` will be passed to the constructor of *cls*. If ``None`` (the default...
trusted_official_docs
CPython Docs
:param fp: A ``.read()``-supporting :term:`text file` or :term:`binary file` containing the JSON document to be deserialized. :type fp: :term:`file-like object` :param cls: If set, a custom JSON decoder. Additional keyword arguments to :func:`!load` will be passed to the constructor of *cls*. If ``None`` (the default...
:param fp: A ``.read()``-supporting :term:`text file` or :term:`binary file` containing the JSON document to be deserialized. :type fp: :term:`file-like object` :param cls: If set, a custom JSON decoder. Additional keyword arguments to :func:`!load` will be passed to the constructor of *cls*. If ``None`` (the default...
python, official-docs, cpython, P0
Local_Trusted_Corpus
551245c5-d78c-4ac9-9432-8b93059cf34a
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,890
supabase-export-v2
a16191538b4091e9
NaN number values. Despite that, by default, this module accepts and outputs ``Infinity``, ``-Infinity``, and ``NaN`` as if they were valid JSON number literal values:: >>> # Neither of these calls raises an exception, but the results are not valid JSON >>> json.dumps(float('-inf')) '-Infinity' >>> json.dumps(float(...
trusted_official_docs
CPython Docs
NaN number values. Despite that, by default, this module accepts and outputs ``Infinity``, ``-Infinity``, and ``NaN`` as if they were valid JSON number literal values:: >>> # Neither of these calls raises an exception, but the results are not valid JSON >>> json.dumps(float('-inf')) '-Infinity' >>> json.dumps(float(...
NaN number values. Despite that, by default, this module accepts and outputs ``Infinity``, ``-Infinity``, and ``NaN`` as if they were valid JSON number literal values:: >>> # Neither of these calls raises an exception, but the results are not valid JSON >>> json.dumps(float('-inf')) '-Infinity' >>> json.dumps(float(...
python, official-docs, cpython, P0
Local_Trusted_Corpus
573b1863-b3b5-402d-b145-f027cbb39334
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,902
supabase-export-v2
cde20ac8dd60e780
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.
trusted_official_docs
CPython Docs
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.
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.
python, official-docs, cpython, P0
Local_Trusted_Corpus
57eace19-c6fe-499c-aaec-080f80042c93
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,889
supabase-export-v2
a365429e54931640
Infinite and NaN Number Values ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The RFC does not permit the representation of infinite or NaN number values. Despite that, by default, this module accepts and outputs ``Infinity``, ``-Infinity``, and ``NaN`` as if they were valid JSON number literal values::
trusted_official_docs
CPython Docs
Infinite and NaN Number Values ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The RFC does not permit the representation of infinite or NaN number values. Despite that, by default, this module accepts and outputs ``Infinity``, ``-Infinity``, and ``NaN`` as if they were valid JSON number literal values::
Infinite and NaN Number Values ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The RFC does not permit the representation of infinite or NaN number values. Despite that, by default, this module accepts and outputs ``Infinity``, ``-Infinity``, and ``NaN`` as if they were valid JSON number literal values::
python, official-docs, cpython, P0
Local_Trusted_Corpus
594cd9dd-e1ba-43f3-8776-6d994d3089aa
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,885
supabase-export-v2
30289c7bfb7483e1
required, by the RFC, this module's serializer sets *ensure_ascii=True* by default, thus escaping the output so that the resulting strings only contain printable ASCII characters. Other than the *ensure_ascii* parameter, this module is defined strictly in terms of conversion between Python objects and :class:`Unicode s...
trusted_official_docs
CPython Docs
required, by the RFC, this module's serializer sets *ensure_ascii=True* by default, thus escaping the output so that the resulting strings only contain printable ASCII characters. Other than the *ensure_ascii* parameter, this module is defined strictly in terms of conversion between Python objects and :class:`Unicode s...
required, by the RFC, this module's serializer sets *ensure_ascii=True* by default, thus escaping the output so that the resulting strings only contain printable ASCII characters. Other than the *ensure_ascii* parameter, this module is defined strictly in terms of conversion between Python objects and :class:`Unicode s...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5b645e21-7b85-473f-8ba0-0f44a557e987
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,807
supabase-export-v2
de6a30649fa5e71f
* All optional parameters are now :ref:`keyword-only <keyword-only_parameter>`. * *fp* can now be a :term:`binary file`. The input encoding should be UTF-8, UTF-16 or UTF-32. .. versionchanged:: 3.11 The default *parse_int* of :func:`int` now limits the maximum length of the integer string via the interpreter's :ref:...
trusted_official_docs
CPython Docs
* All optional parameters are now :ref:`keyword-only <keyword-only_parameter>`. * *fp* can now be a :term:`binary file`. The input encoding should be UTF-8, UTF-16 or UTF-32. .. versionchanged:: 3.11 The default *parse_int* of :func:`int` now limits the maximum length of the integer string via the interpreter's :ref:...
* All optional parameters are now :ref:`keyword-only <keyword-only_parameter>`. * *fp* can now be a :term:`binary file`. The input encoding should be UTF-8, UTF-16 or UTF-32. .. versionchanged:: 3.11 The default *parse_int* of :func:`int` now limits the maximum length of the integer string via the interpreter's :ref:...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5bf2874f-8ffa-4ed0-a9fb-9b78e2d5b3cd
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,763
supabase-export-v2
b797fafd9262a1fb
json { "json": "obj" } $ echo '{1.2:3.4}' | python -m json Expecting property name enclosed in double quotes: line 1 column 2 (char 1) See :ref:`json-commandline` for detailed documentation.
trusted_official_docs
CPython Docs
json { "json": "obj" } $ echo '{1.2:3.4}' | python -m json Expecting property name enclosed in double quotes: line 1 column 2 (char 1) See :ref:`json-commandline` for detailed documentation.
json { "json": "obj" } $ echo '{1.2:3.4}' | python -m json Expecting property name enclosed in double quotes: line 1 column 2 (char 1) See :ref:`json-commandline` for detailed documentation.
python, official-docs, cpython, P0
Local_Trusted_Corpus
667d0479-c520-45bc-9085-de741714c7bc
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,776
supabase-export-v2
71ead973cc2346ec
If ``True``, keys that are not of a basic type (:class:`str`, :class:`int`, :class:`float`, :class:`bool`, ``None``) will be skipped instead of raising a :exc:`TypeError`. Default ``False``. :param bool ensure_ascii: If ``True`` (the default), the output is guaranteed to have all incoming non-ASCII and non-printable ...
trusted_official_docs
CPython Docs
If ``True``, keys that are not of a basic type (:class:`str`, :class:`int`, :class:`float`, :class:`bool`, ``None``) will be skipped instead of raising a :exc:`TypeError`. Default ``False``. :param bool ensure_ascii: If ``True`` (the default), the output is guaranteed to have all incoming non-ASCII and non-printable ...
If ``True``, keys that are not of a basic type (:class:`str`, :class:`int`, :class:`float`, :class:`bool`, ``None``) will be skipped instead of raising a :exc:`TypeError`. Default ``False``. :param bool ensure_ascii: If ``True`` (the default), the output is guaranteed to have all incoming non-ASCII and non-printable ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
692d9f5a-c58c-478f-823f-e760656f01a3
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,844
supabase-export-v2
824a000fbf1d9b3c
a :meth:`~JSONEncoder.default` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise :exc:`TypeError`). If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when trying to encode keys that are not :class:...
trusted_official_docs
CPython Docs
a :meth:`~JSONEncoder.default` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise :exc:`TypeError`). If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when trying to encode keys that are not :class:...
a :meth:`~JSONEncoder.default` method with another method that returns a serializable object for ``o`` if possible, otherwise it should call the superclass implementation (to raise :exc:`TypeError`). If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when trying to encode keys that are not :class:...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6aea9b4b-2104-4434-b1e7-e8413090a639
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,793
supabase-export-v2
67eb7daba97aaf6f
Deserialize *fp* to a Python object using the :ref:`JSON-to-Python conversion table <json-to-py-table>`. :param fp: A ``.read()``-supporting :term:`text file` or :term:`binary file` containing the JSON document to be deserialized. :type fp: :term:`file-like object`
trusted_official_docs
CPython Docs
Deserialize *fp* to a Python object using the :ref:`JSON-to-Python conversion table <json-to-py-table>`. :param fp: A ``.read()``-supporting :term:`text file` or :term:`binary file` containing the JSON document to be deserialized. :type fp: :term:`file-like object`
Deserialize *fp* to a Python object using the :ref:`JSON-to-Python conversion table <json-to-py-table>`. :param fp: A ``.read()``-supporting :term:`text file` or :term:`binary file` containing the JSON document to be deserialized. :type fp: :term:`file-like object`
python, official-docs, cpython, P0
Local_Trusted_Corpus
7044320e-79b9-4ce7-b19a-19ddb53d1a69
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,826
supabase-export-v2
6d9463097fe9c247
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`). *parse_int* is an optional function that will be called with the string of every JSON int to be decoded. By default, this is equivalent to ``int(num_...
trusted_official_docs
CPython Docs
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`). *parse_int* is an optional function that will be called with the string of every JSON int to be decoded. By default, this is equivalent to ``int(num_...
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`). *parse_int* is an optional function that will be called with the string of every JSON int to be decoded. By default, this is equivalent to ``int(num_...
python, official-docs, cpython, P0
Local_Trusted_Corpus
74372378-38a8-4997-bf86-4b3d511d13da
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,777
supabase-export-v2
263785c5cc26b6e0
all characters will be outputted as-is, except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters U+0000 through U+001F. :param bool check_circular: If ``False``, the circular reference check for container types is skipped and a circular reference will result in a :ex...
trusted_official_docs
CPython Docs
all characters will be outputted as-is, except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters U+0000 through U+001F. :param bool check_circular: If ``False``, the circular reference check for container types is skipped and a circular reference will result in a :ex...
all characters will be outputted as-is, except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters U+0000 through U+001F. :param bool check_circular: If ``False``, the circular reference check for container types is skipped and a circular reference will result in a :ex...
python, official-docs, cpython, P0
Local_Trusted_Corpus
796f1414-ac3e-4f96-bf39-f51625d894be
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,894
supabase-export-v2
b2c57a0850196240
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:: >>> weird_json = '{"x": 1, "x": 2, "x": 3}' >>> json.loads(weird_json) {'x': 3}
trusted_official_docs
CPython Docs
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:: >>> weird_json = '{"x": 1, "x": 2, "x": 3}' >>> json.loads(weird_json) {'x': 3}
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:: >>> weird_json = '{"x": 1, "x": 2, "x": 3}' >>> json.loads(weird_json) {'x': 3}
python, official-docs, cpython, P0
Local_Trusted_Corpus
79b59006-c1af-4217-9267-33e2673ff934
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,828
supabase-export-v2
411b86bcfc55b216
be called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to raise an exception if invalid JSON numbers are encountered. If *strict* is false (``True`` is the default), then control characters will be allowed inside strings. Control characters in this context are those ...
trusted_official_docs
CPython Docs
be called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to raise an exception if invalid JSON numbers are encountered. If *strict* is false (``True`` is the default), then control characters will be allowed inside strings. Control characters in this context are those ...
be called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to raise an exception if invalid JSON numbers are encountered. If *strict* is false (``True`` is the default), then control characters will be allowed inside strings. Control characters in this context are those ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7d1f6caa-6020-4167-8c7c-b043321d1b38
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,854
supabase-export-v2
282aab53ab39d5a5
that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a :exc:`TypeError`. If not specified, :exc:`TypeError` is raised. .. versionchanged:: 3.6 All parameters are now :ref:`keyword-only <keyword-only_parameter>`.
trusted_official_docs
CPython Docs
that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a :exc:`TypeError`. If not specified, :exc:`TypeError` is raised. .. versionchanged:: 3.6 All parameters are now :ref:`keyword-only <keyword-only_parameter>`.
that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a :exc:`TypeError`. If not specified, :exc:`TypeError` is raised. .. versionchanged:: 3.6 All parameters are now :ref:`keyword-only <keyword-only_parameter>`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7e392397-fd25-4cc4-b925-70353afdbfa9
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,821
supabase-export-v2
707a27c9a5da110b
value will be used in place of the given :class:`dict`. This can be used to provide custom deserializations (e.g. to support `JSON-RPC <https://www.jsonrpc.org>`_ class hinting). *object_pairs_hook* is an optional function that will be called with the result of every JSON object decoded with an ordered list of pairs. ...
trusted_official_docs
CPython Docs
value will be used in place of the given :class:`dict`. This can be used to provide custom deserializations (e.g. to support `JSON-RPC <https://www.jsonrpc.org>`_ class hinting). *object_pairs_hook* is an optional function that will be called with the result of every JSON object decoded with an ordered list of pairs. ...
value will be used in place of the given :class:`dict`. This can be used to provide custom deserializations (e.g. to support `JSON-RPC <https://www.jsonrpc.org>`_ class hinting). *object_pairs_hook* is an optional function that will be called with the result of every JSON object decoded with an ordered list of pairs. ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
80166ac8-5e0d-48de-9b75-6b7e06557db8
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,825
supabase-export-v2
4b4fa654ac03701d
.. versionchanged:: 3.15 Added support for *array_hook*. *parse_float* is an optional function that 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`...
trusted_official_docs
CPython Docs
.. versionchanged:: 3.15 Added support for *array_hook*. *parse_float* is an optional function that 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`...
.. versionchanged:: 3.15 Added support for *array_hook*. *parse_float* is an optional function that 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`...
python, official-docs, cpython, P0
Local_Trusted_Corpus
837c41da-bc44-49c0-b483-e954c6a51253
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,779
supabase-export-v2
19ac4588c8f62a64
``-inf``) will result in a :exc:`ValueError`, in strict compliance with the JSON specification. If ``True`` (the default), their JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``) are used. :param cls: If set, a custom JSON encoder with the :meth:`~JSONEncoder.default` method overridden, for serializing i...
trusted_official_docs
CPython Docs
``-inf``) will result in a :exc:`ValueError`, in strict compliance with the JSON specification. If ``True`` (the default), their JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``) are used. :param cls: If set, a custom JSON encoder with the :meth:`~JSONEncoder.default` method overridden, for serializing i...
``-inf``) will result in a :exc:`ValueError`, in strict compliance with the JSON specification. If ``True`` (the default), their JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``) are used. :param cls: If set, a custom JSON encoder with the :meth:`~JSONEncoder.default` method overridden, for serializing i...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8408fc8d-cfcd-4d13-a258-3b4b689fc59a
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,880
supabase-export-v2
cbea430b029f95bb
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: - 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.
trusted_official_docs
CPython Docs
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: - 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.
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: - 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.
python, official-docs, cpython, P0
Local_Trusted_Corpus
86844103-080b-4749-8067-ea6e3898b5d9
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,824
supabase-export-v2
706cae6c28530dec
decoded as a list. The return value of *array_hook* will be used instead of the :class:`list`. This feature can be used to implement custom decoders. .. versionchanged:: 3.15 Added support for *array_hook*.
trusted_official_docs
CPython Docs
decoded as a list. The return value of *array_hook* will be used instead of the :class:`list`. This feature can be used to implement custom decoders. .. versionchanged:: 3.15 Added support for *array_hook*.
decoded as a list. The return value of *array_hook* will be used instead of the :class:`list`. This feature can be used to implement custom decoders. .. versionchanged:: 3.15 Added support for *array_hook*.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8902a3a0-b39d-4ff6-ac89-2a5cea05fa1c
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,829
supabase-export-v2
5633467717748cc2
be allowed inside strings. Control characters in this context are those with character codes in the 0--31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. If the data being deserialized is not a valid JSON document, a :exc:`JSONDecodeError` will be raised.
trusted_official_docs
CPython Docs
be allowed inside strings. Control characters in this context are those with character codes in the 0--31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. If the data being deserialized is not a valid JSON document, a :exc:`JSONDecodeError` will be raised.
be allowed inside strings. Control characters in this context are those with character codes in the 0--31 range, including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``. If the data being deserialized is not a valid JSON document, a :exc:`JSONDecodeError` will be raised.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8f0b5903-37bb-41f7-8371-ea9e9002e972
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,842
supabase-export-v2
4918440b1ffa5f69
& float-derived Enums | number | +----------------------------------------+---------------+ | True | true | +----------------------------------------+---------------+ | False | false | +----------------------------------------+---------------+ | None | null | +----------------------------------------+---------------+ ....
trusted_official_docs
CPython Docs
& float-derived Enums | number | +----------------------------------------+---------------+ | True | true | +----------------------------------------+---------------+ | False | false | +----------------------------------------+---------------+ | None | null | +----------------------------------------+---------------+ ....
& float-derived Enums | number | +----------------------------------------+---------------+ | True | true | +----------------------------------------+---------------+ | False | false | +----------------------------------------+---------------+ | None | null | +----------------------------------------+---------------+ ....
python, official-docs, cpython, P0
Local_Trusted_Corpus
8f63a20a-b39c-443e-84ef-c31e5b1d5a93
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,914
supabase-export-v2
31b75758f3e5e3f1
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. .. versionchanged:: 3.14 The :mod:`!json` module may now be directly executed as ``python -m json``. For backwards compatibility, invoking the CLI as ``python -m json.t...
trusted_official_docs
CPython Docs
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. .. versionchanged:: 3.14 The :mod:`!json` module may now be directly executed as ``python -m json``. For backwards compatibility, invoking the CLI as ``python -m json.t...
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. .. versionchanged:: 3.14 The :mod:`!json` module may now be directly executed as ``python -m json``. For backwards compatibility, invoking the CLI as ``python -m json.t...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9080327c-79d2-4801-9878-9a87b61af180
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,903
supabase-export-v2
d8057d8c3573f065
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 pr...
trusted_official_docs
CPython Docs
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 pr...
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 pr...
python, official-docs, cpython, P0
Local_Trusted_Corpus
91ebb730-8dcf-4bce-b70b-1d3f0899150d
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,901
supabase-export-v2
313ef43000e5cd9e
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
trusted_official_docs
CPython Docs
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
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
python, official-docs, cpython, P0
Local_Trusted_Corpus
93b43870-b8c7-414f-9e88-50a76b589f0a
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,892
supabase-export-v2
18f62e57cf018fca
the serializer, the *allow_nan* parameter can be used to alter this behavior. In the deserializer, the *parse_constant* parameter can be used to alter this behavior. Repeated Names Within an Object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
trusted_official_docs
CPython Docs
the serializer, the *allow_nan* parameter can be used to alter this behavior. In the deserializer, the *parse_constant* parameter can be used to alter this behavior. Repeated Names Within an Object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
the serializer, the *allow_nan* parameter can be used to alter this behavior. In the deserializer, the *parse_constant* parameter can be used to alter this behavior. Repeated Names Within an Object ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
python, official-docs, cpython, P0
Local_Trusted_Corpus
93ba711f-16e1-4823-a5c9-e55c28795e83
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,783
supabase-export-v2
4a34ef8db48149ce
should return a JSON encodable version of the object or raise a :exc:`TypeError`. If ``None`` (the default), :exc:`!TypeError` is raised. :type default: :term:`callable` | None :param bool sort_keys: If ``True``, dictionaries will be outputted sorted by key. Default ``False``.
trusted_official_docs
CPython Docs
should return a JSON encodable version of the object or raise a :exc:`TypeError`. If ``None`` (the default), :exc:`!TypeError` is raised. :type default: :term:`callable` | None :param bool sort_keys: If ``True``, dictionaries will be outputted sorted by key. Default ``False``.
should return a JSON encodable version of the object or raise a :exc:`TypeError`. If ``None`` (the default), :exc:`!TypeError` is raised. :type default: :term:`callable` | None :param bool sort_keys: If ``True``, dictionaries will be outputted sorted by key. Default ``False``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
9a18c572-082d-4f67-af13-67095e26f101
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,800
supabase-export-v2
416366e6f37a2605
default), it is equivalent to ``int(num_str)``. This can be used to parse JSON integers into custom datatypes, for example :class:`float`. :type parse_int: :term:`callable` | None :param parse_constant: If set, a function that is called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, or ``'NaN'``....
trusted_official_docs
CPython Docs
default), it is equivalent to ``int(num_str)``. This can be used to parse JSON integers into custom datatypes, for example :class:`float`. :type parse_int: :term:`callable` | None :param parse_constant: If set, a function that is called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, or ``'NaN'``....
default), it is equivalent to ``int(num_str)``. This can be used to parse JSON integers into custom datatypes, for example :class:`float`. :type parse_int: :term:`callable` | None :param parse_constant: If set, a function that is called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, or ``'NaN'``....
python, official-docs, cpython, P0
Local_Trusted_Corpus
9b55295e-e069-494c-9b93-a91aa6495dd8
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,837
supabase-export-v2
d1fdf565391b623f
This can be used to decode a JSON document from a string that may have extraneous data at the end. .. class:: JSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
trusted_official_docs
CPython Docs
This can be used to decode a JSON document from a string that may have extraneous data at the end. .. class:: JSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
This can be used to decode a JSON document from a string that may have extraneous data at the end. .. class:: JSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
python, official-docs, cpython, P0
Local_Trusted_Corpus
9dbbbaef-fff9-4116-9186-7b4a82c85685
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,827
supabase-export-v2
a1a28ac725787b35
to be decoded. By default, this is equivalent to ``int(num_str)``. This can be used to use another datatype or parser for JSON integers (e.g. :class:`float`). *parse_constant* is an optional function that will be called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to...
trusted_official_docs
CPython Docs
to be decoded. By default, this is equivalent to ``int(num_str)``. This can be used to use another datatype or parser for JSON integers (e.g. :class:`float`). *parse_constant* is an optional function that will be called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to...
to be decoded. By default, this is equivalent to ``int(num_str)``. This can be used to use another datatype or parser for JSON integers (e.g. :class:`float`). *parse_constant* is an optional function that will be called with one of the following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to...
python, official-docs, cpython, P0
Local_Trusted_Corpus
ae6d992b-0472-4eeb-973f-7e9758f9fe9a
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,886
supabase-export-v2
ad9a8137617ac6a5
defined strictly in terms of conversion between Python objects and :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. T...
trusted_official_docs
CPython Docs
defined strictly in terms of conversion between Python objects and :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. T...
defined strictly in terms of conversion between Python objects and :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. T...
python, official-docs, cpython, P0
Local_Trusted_Corpus
b2dc2a15-4e27-4ff8-ae87-44b409575ae8
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,919
supabase-export-v2
460b9988f4092af1
.. code-block:: shell-session $ python -m json mp_films.json [ { "title": "And Now for Something Completely Different", "year": 1971 }, { "title": "Monty Python and the Holy Grail", "year": 1975 } ]
trusted_official_docs
CPython Docs
.. code-block:: shell-session $ python -m json mp_films.json [ { "title": "And Now for Something Completely Different", "year": 1971 }, { "title": "Monty Python and the Holy Grail", "year": 1975 } ]
.. code-block:: shell-session $ python -m json mp_films.json [ { "title": "And Now for Something Completely Different", "year": 1971 }, { "title": "Monty Python and the Holy Grail", "year": 1975 } ]
python, official-docs, cpython, P0
Local_Trusted_Corpus
b2fd1b63-04fd-48b6-a2c4-ef08c805b46e
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,849
supabase-export-v2
8e7b5d5707c5beee
of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If *indent* is a non-negative integer or string, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0, negativ...
trusted_official_docs
CPython Docs
of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If *indent* is a non-negative integer or string, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0, negativ...
of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. If *indent* is a non-negative integer or string, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0, negativ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
b3935bbf-f12c-49f5-8599-cfac2d8d674d
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,798
supabase-export-v2
bddb9b3660b94f4e
this function will be used instead of the :class:`list`. This feature can be used to implement custom decoders. Default ``None``. :type array_hook: :term:`callable` | None :param parse_float: If set, a function that is called with the string of every JSON float to be decoded. If ``None`` (the default), it is equivale...
trusted_official_docs
CPython Docs
this function will be used instead of the :class:`list`. This feature can be used to implement custom decoders. Default ``None``. :type array_hook: :term:`callable` | None :param parse_float: If set, a function that is called with the string of every JSON float to be decoded. If ``None`` (the default), it is equivale...
this function will be used instead of the :class:`list`. This feature can be used to implement custom decoders. Default ``None``. :type array_hook: :term:`callable` | None :param parse_float: If set, a function that is called with the string of every JSON float to be decoded. If ``None`` (the default), it is equivale...
python, official-docs, cpython, P0
Local_Trusted_Corpus
b678d2f5-e1df-412a-8791-aefe3cf8c4d7
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,753
supabase-export-v2
9c7a041fe4bcf415
Customizing JSON object encoding:: >>> import json >>> def custom_json(obj): ... if isinstance(obj, complex): ... return {'__complex__': True, 'real': obj.real, 'imag': obj.imag} ... raise TypeError(f'Cannot serialize object of {type(obj)}') ... >>> json.dumps(1 + 2j, default=custom_json) '{"__complex__": true, "...
trusted_official_docs
CPython Docs
Customizing JSON object encoding:: >>> import json >>> def custom_json(obj): ... if isinstance(obj, complex): ... return {'__complex__': True, 'real': obj.real, 'imag': obj.imag} ... raise TypeError(f'Cannot serialize object of {type(obj)}') ... >>> json.dumps(1 + 2j, default=custom_json) '{"__complex__": true, "...
Customizing JSON object encoding:: >>> import json >>> def custom_json(obj): ... if isinstance(obj, complex): ... return {'__complex__': True, 'real': obj.real, 'imag': obj.imag} ... raise TypeError(f'Cannot serialize object of {type(obj)}') ... >>> json.dumps(1 + 2j, default=custom_json) '{"__complex__": true, "...
python, official-docs, cpython, P0
Local_Trusted_Corpus
b7100950-7741-47e4-b726-a75d1a59f13d
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,775
supabase-export-v2
4b04a69283c8ab79
*obj* will be serialized to. The :mod:`!json` module always produces :class:`str` objects, not :class:`bytes` objects, therefore ``fp.write()`` must support :class:`str` input. :type fp: :term:`file-like object` :param bool skipkeys: If ``True``, keys that are not of a basic type (:class:`str`, :class:`int`, :class:`...
trusted_official_docs
CPython Docs
*obj* will be serialized to. The :mod:`!json` module always produces :class:`str` objects, not :class:`bytes` objects, therefore ``fp.write()`` must support :class:`str` input. :type fp: :term:`file-like object` :param bool skipkeys: If ``True``, keys that are not of a basic type (:class:`str`, :class:`int`, :class:`...
*obj* will be serialized to. The :mod:`!json` module always produces :class:`str` objects, not :class:`bytes` objects, therefore ``fp.write()`` must support :class:`str` input. :type fp: :term:`file-like object` :param bool skipkeys: If ``True``, keys that are not of a basic type (:class:`str`, :class:`int`, :class:`...
python, official-docs, cpython, P0
Local_Trusted_Corpus
b7372f46-e632-4763-afc6-49a7d10780a7
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,881
supabase-export-v2
3140db966baf0bdf
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. Since the RFC permits RFC-compliant parsers to accept input texts that are not RFC-compliant, this module's deserializer is technically RFC-compliant under default settings.
trusted_official_docs
CPython Docs
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. Since the RFC permits RFC-compliant parsers to accept input texts that are not RFC-compliant, this module's deserializer is technically RFC-compliant under default settings.
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. Since the RFC permits RFC-compliant parsers to accept input texts that are not RFC-compliant, this module's deserializer is technically RFC-compliant under default settings.
python, official-docs, cpython, P0
Local_Trusted_Corpus
ba00fb52-37cf-4a27-80c2-c72dfb0bcae1
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,747
supabase-export-v2
f51d3cf974e77158
Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print(json.dumps("\"foo\bar")) "\"foo\bar" >>> print(json.dumps('\u1234')) "\u1234" >>> print(json.dumps('\\')) "\\" >>> print(json.dumps({"c": 0, "b"...
trusted_official_docs
CPython Docs
Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print(json.dumps("\"foo\bar")) "\"foo\bar" >>> print(json.dumps('\u1234')) "\u1234" >>> print(json.dumps('\\')) "\\" >>> print(json.dumps({"c": 0, "b"...
Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print(json.dumps("\"foo\bar")) "\"foo\bar" >>> print(json.dumps('\u1234')) "\u1234" >>> print(json.dumps('\\')) "\\" >>> print(json.dumps({"c": 0, "b"...
python, official-docs, cpython, P0
Local_Trusted_Corpus
bc82e66d-0f12-4225-aa85-eed3f30a22e4
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,770
supabase-export-v2
211c393c8cc9ddee
.. function:: dump(obj, fp, *, skipkeys=False, ensure_ascii=True, \ check_circular=True, allow_nan=True, cls=None, \ indent=None, separators=None, default=None, \ sort_keys=False, **kw) Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting :term:`file-like object`) using this :ref:`Python-to-JS...
trusted_official_docs
CPython Docs
.. function:: dump(obj, fp, *, skipkeys=False, ensure_ascii=True, \ check_circular=True, allow_nan=True, cls=None, \ indent=None, separators=None, default=None, \ sort_keys=False, **kw) Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting :term:`file-like object`) using this :ref:`Python-to-JS...
.. function:: dump(obj, fp, *, skipkeys=False, ensure_ascii=True, \ check_circular=True, allow_nan=True, cls=None, \ indent=None, separators=None, default=None, \ sort_keys=False, **kw) Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting :term:`file-like object`) using this :ref:`Python-to-JS...
python, official-docs, cpython, P0
Local_Trusted_Corpus
be815d5b-d7d9-413f-b995-345c63cee598
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,773
supabase-export-v2
7bf2ceccd6ce6823
a framed protocol, so trying to serialize multiple objects with repeated calls to :func:`dump` using the same *fp* will result in an invalid JSON file. :param object obj: The Python object to be serialized.
trusted_official_docs
CPython Docs
a framed protocol, so trying to serialize multiple objects with repeated calls to :func:`dump` using the same *fp* will result in an invalid JSON file. :param object obj: The Python object to be serialized.
a framed protocol, so trying to serialize multiple objects with repeated calls to :func:`dump` using the same *fp* will result in an invalid JSON file. :param object obj: The Python object to be serialized.
python, official-docs, cpython, P0
Local_Trusted_Corpus
c15ed7fc-09dd-4906-8893-66c98dfdd9db
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,857
supabase-export-v2
e6af0414d752dd65
Implement this method in a subclass such that it returns a serializable object for *o*, or calls the base implementation (to raise a :exc:`TypeError`). For example, to support arbitrary iterators, you could implement :meth:`~JSONEncoder.default` like this::
trusted_official_docs
CPython Docs
Implement this method in a subclass such that it returns a serializable object for *o*, or calls the base implementation (to raise a :exc:`TypeError`). For example, to support arbitrary iterators, you could implement :meth:`~JSONEncoder.default` like this::
Implement this method in a subclass such that it returns a serializable object for *o*, or calls the base implementation (to raise a :exc:`TypeError`). For example, to support arbitrary iterators, you could implement :meth:`~JSONEncoder.default` like this::
python, official-docs, cpython, P0
Local_Trusted_Corpus
c430180a-1a5b-40b4-9e71-8aa91be8ce6d
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,762
supabase-export-v2
8469ae366e1df393
.. code-block:: shell-session $ echo '{"json":"obj"}' | python -m json { "json": "obj" } $ echo '{1.2:3.4}' | python -m json Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
trusted_official_docs
CPython Docs
.. code-block:: shell-session $ echo '{"json":"obj"}' | python -m json { "json": "obj" } $ echo '{1.2:3.4}' | python -m json Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
.. code-block:: shell-session $ echo '{"json":"obj"}' | python -m json { "json": "obj" } $ echo '{1.2:3.4}' | python -m json Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
python, official-docs, cpython, P0
Local_Trusted_Corpus
c68c05f1-e482-43fe-9116-01fe8ea5f993
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,879
supabase-export-v2
2a3f8797d7cbbbff
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...
trusted_official_docs
CPython Docs
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...
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...
python, official-docs, cpython, P0
Local_Trusted_Corpus
c81f2450-83eb-4324-a908-b853f46b2921
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,788
supabase-export-v2
19a6a8c653ffcfcc
.. function:: dumps(obj, *, skipkeys=False, ensure_ascii=True, \ check_circular=True, allow_nan=True, cls=None, \ indent=None, separators=None, default=None, \ sort_keys=False, **kw) Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion table <py-to-json-table>`. The arguments have the same mean...
trusted_official_docs
CPython Docs
.. function:: dumps(obj, *, skipkeys=False, ensure_ascii=True, \ check_circular=True, allow_nan=True, cls=None, \ indent=None, separators=None, default=None, \ sort_keys=False, **kw) Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion table <py-to-json-table>`. The arguments have the same mean...
.. function:: dumps(obj, *, skipkeys=False, ensure_ascii=True, \ check_circular=True, allow_nan=True, cls=None, \ indent=None, separators=None, default=None, \ sort_keys=False, **kw) Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion table <py-to-json-table>`. The arguments have the same mean...
python, official-docs, cpython, P0
Local_Trusted_Corpus
ce335374-56a5-4e11-a6a0-ad40e6cffd81
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,743
supabase-export-v2
b9a9fc2d50d9dc8b
<https://ecma-international.org/publications-and-standards/standards/ecma-404/>`_, is a lightweight data interchange format inspired by `JavaScript <https://en.wikipedia.org/wiki/JavaScript>`_ object literal syntax (although it is not a strict subset of JavaScript [#rfc-errata]_ ). .. note:: The term "object" in the c...
trusted_official_docs
CPython Docs
<https://ecma-international.org/publications-and-standards/standards/ecma-404/>`_, is a lightweight data interchange format inspired by `JavaScript <https://en.wikipedia.org/wiki/JavaScript>`_ object literal syntax (although it is not a strict subset of JavaScript [#rfc-errata]_ ). .. note:: The term "object" in the c...
<https://ecma-international.org/publications-and-standards/standards/ecma-404/>`_, is a lightweight data interchange format inspired by `JavaScript <https://en.wikipedia.org/wiki/JavaScript>`_ object literal syntax (although it is not a strict subset of JavaScript [#rfc-errata]_ ). .. note:: The term "object" in the c...
python, official-docs, cpython, P0
Local_Trusted_Corpus
cf8ab604-3f7e-4a8e-8049-5e95634016b4
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,891
supabase-export-v2
3bdc239aafa58ab6
exception, but the results are not valid JSON >>> json.dumps(float('-inf')) '-Infinity' >>> json.dumps(float('nan')) 'NaN' >>> # Same when deserializing >>> json.loads('-Infinity') -inf >>> json.loads('NaN') nan In the serializer, the *allow_nan* parameter can be used to alter this behavior. In the deserializer, the *p...
trusted_official_docs
CPython Docs
exception, but the results are not valid JSON >>> json.dumps(float('-inf')) '-Infinity' >>> json.dumps(float('nan')) 'NaN' >>> # Same when deserializing >>> json.loads('-Infinity') -inf >>> json.loads('NaN') nan In the serializer, the *allow_nan* parameter can be used to alter this behavior. In the deserializer, the *p...
exception, but the results are not valid JSON >>> json.dumps(float('-inf')) '-Infinity' >>> json.dumps(float('nan')) 'NaN' >>> # Same when deserializing >>> json.loads('-Infinity') -inf >>> json.loads('NaN') nan In the serializer, the *allow_nan* parameter can be used to alter this behavior. In the deserializer, the *p...
python, official-docs, cpython, P0
Local_Trusted_Corpus
cfee60f2-4481-4bf1-97b1-3279f5de18d2
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,852
supabase-export-v2
847c9669ce8b9bbf
')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. .. versionchanged:: 3.4 Use ``(',', ': ')`` as default if *indent* is not ``None``.
trusted_official_docs
CPython Docs
')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. .. versionchanged:: 3.4 Use ``(',', ': ')`` as default if *indent* is not ``None``.
')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. .. versionchanged:: 3.4 Use ``(',', ': ')`` as default if *indent* is not ``None``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
dac5394e-e5a2-4c2a-8d6b-176796c679e2
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,780
supabase-export-v2
07b96b8a86d7da59
custom JSON encoder with the :meth:`~JSONEncoder.default` method overridden, for serializing into custom datatypes. If ``None`` (the default), :class:`!JSONEncoder` is used. :type cls: a :class:`JSONEncoder` subclass :param indent: If a positive integer or string, JSON array elements and object members will be pretty...
trusted_official_docs
CPython Docs
custom JSON encoder with the :meth:`~JSONEncoder.default` method overridden, for serializing into custom datatypes. If ``None`` (the default), :class:`!JSONEncoder` is used. :type cls: a :class:`JSONEncoder` subclass :param indent: If a positive integer or string, JSON array elements and object members will be pretty...
custom JSON encoder with the :meth:`~JSONEncoder.default` method overridden, for serializing into custom datatypes. If ``None`` (the default), :class:`!JSONEncoder` is used. :type cls: a :class:`JSONEncoder` subclass :param indent: If a positive integer or string, JSON array elements and object members will be pretty...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e0526c34-e09f-4166-a5ae-3cc11540553e
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,781
supabase-export-v2
999a870857a136de
``""`` (the empty string), only newlines are inserted. If ``None`` (the default), the most compact representation is used. :type indent: int | str | None :param separators: A two-tuple: ``(item_separator, key_separator)``. If ``None`` (the default), *separators* defaults to ``(', ', ': ')`` if *indent* is ``None``, ...
trusted_official_docs
CPython Docs
``""`` (the empty string), only newlines are inserted. If ``None`` (the default), the most compact representation is used. :type indent: int | str | None :param separators: A two-tuple: ``(item_separator, key_separator)``. If ``None`` (the default), *separators* defaults to ``(', ', ': ')`` if *indent* is ``None``, ...
``""`` (the empty string), only newlines are inserted. If ``None`` (the default), the most compact representation is used. :type indent: int | str | None :param separators: A two-tuple: ``(item_separator, key_separator)``. If ``None`` (the default), *separators* defaults to ``(', ', ': ')`` if *indent* is ``None``, ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e17d9d28-c03d-4e3a-a7a7-6cac6884a8b8
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,760
supabase-export-v2
bbe5d5e3a05a6d1b
... return super().default(obj) ... >>> json.dumps(2 + 1j, cls=ComplexEncoder) '[2.0, 1.0]' >>> ComplexEncoder().encode(2 + 1j) '[2.0, 1.0]' >>> list(ComplexEncoder().iterencode(2 + 1j)) ['[2.0', ', 1.0', ']'] Using :mod:`!json` from the shell to validate and pretty-print:
trusted_official_docs
CPython Docs
... return super().default(obj) ... >>> json.dumps(2 + 1j, cls=ComplexEncoder) '[2.0, 1.0]' >>> ComplexEncoder().encode(2 + 1j) '[2.0, 1.0]' >>> list(ComplexEncoder().iterencode(2 + 1j)) ['[2.0', ', 1.0', ']'] Using :mod:`!json` from the shell to validate and pretty-print:
... return super().default(obj) ... >>> json.dumps(2 + 1j, cls=ComplexEncoder) '[2.0, 1.0]' >>> ComplexEncoder().encode(2 + 1j) '[2.0, 1.0]' >>> list(ComplexEncoder().iterencode(2 + 1j)) ['[2.0', ', 1.0', ']'] Using :mod:`!json` from the shell to validate and pretty-print:
python, official-docs, cpython, P0
Local_Trusted_Corpus
e19c6d31-d418-46f2-9b9c-b89362786967
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,912
supabase-export-v2
d558a9548b501580
.. code-block:: shell-session $ echo '{"json": "obj"}' | python -m json { "json": "obj" } $ echo '{1.2:3.4}' | python -m json Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
trusted_official_docs
CPython Docs
.. code-block:: shell-session $ echo '{"json": "obj"}' | python -m json { "json": "obj" } $ echo '{1.2:3.4}' | python -m json Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
.. code-block:: shell-session $ echo '{"json": "obj"}' | python -m json { "json": "obj" } $ echo '{1.2:3.4}' | python -m json Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
python, official-docs, cpython, P0
Local_Trusted_Corpus
e1c5a09f-e1a2-4515-b30a-ed42049bda5f
CPython Docs
file://datasets/cpython/Doc/library/json.rst
unknown
7ac51696-cba9-43e9-9b4c-20273e8ce411
2,823
supabase-export-v2
0a52098e3d99c3e1
.. versionchanged:: 3.1 Added support for *object_pairs_hook*. *array_hook* is an optional function that will be called with the result of every JSON array decoded as a list. The return value of *array_hook* will be used instead of the :class:`list`. This feature can be used to implement custom decoders.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.1 Added support for *object_pairs_hook*. *array_hook* is an optional function that will be called with the result of every JSON array decoded as a list. The return value of *array_hook* will be used instead of the :class:`list`. This feature can be used to implement custom decoders.
.. versionchanged:: 3.1 Added support for *object_pairs_hook*. *array_hook* is an optional function that will be called with the result of every JSON array decoded as a list. The return value of *array_hook* will be used instead of the :class:`list`. This feature can be used to implement custom decoders.
python, official-docs, cpython, P0
Local_Trusted_Corpus