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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7471c9fd-12dc-444e-bfa5-544c3ecdaa5c | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,771 | supabase-export-v2 | cfb072cd79590f6a | strings passed to the module-level functions are cached, so programs that use only a few format strings needn't worry about reusing a single :class:`Struct` instance.
Compiled Struct objects support the following methods and attributes: | trusted_official_docs | CPython Docs | strings passed to the module-level functions are cached, so programs that use only a few format strings needn't worry about reusing a single :class:`Struct` instance.
Compiled Struct objects support the following methods and attributes: | strings passed to the module-level functions are cached, so programs that use only a few format strings needn't worry about reusing a single :class:`Struct` instance.
Compiled Struct objects support the following methods and attributes: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7e75dc25-3b17-4fbb-92c9-97af70dd4486 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,677 | supabase-export-v2 | abf291f8fe83b879 | Format Strings --------------
Format strings describe the data layout when
packing and unpacking data. They are built up from :ref:`format characters<format-characters>`,
which specify the type of data being packed/unpacked. In addition,
special characters control the :ref:`byte order, size and alignment<struct-alignme... | trusted_official_docs | CPython Docs | Format Strings --------------
Format strings describe the data layout when
packing and unpacking data. They are built up from :ref:`format characters<format-characters>`,
which specify the type of data being packed/unpacked. In addition,
special characters control the :ref:`byte order, size and alignment<struct-alignme... | Format Strings --------------
Format strings describe the data layout when
packing and unpacking data. They are built up from :ref:`format characters<format-characters>`,
which specify the type of data being packed/unpacked. In addition,
special characters control the :ref:`byte order, size and alignment<struct-alignme... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
83c20ecd-7bcd-425b-9001-8da20f0314fc | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,680 | supabase-export-v2 | 45fb5538f0289099 | Byte Order, Size, and Alignment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
By default, C types are represented in the machine's native format and byte
order, and properly aligned by skipping pad bytes if necessary (according to the
rules used by the C compiler). This behavior is chosen so
that the bytes of a packed struct corresp... | trusted_official_docs | CPython Docs | Byte Order, Size, and Alignment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
By default, C types are represented in the machine's native format and byte
order, and properly aligned by skipping pad bytes if necessary (according to the
rules used by the C compiler). This behavior is chosen so
that the bytes of a packed struct corresp... | Byte Order, Size, and Alignment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
By default, C types are represented in the machine's native format and byte
order, and properly aligned by skipping pad bytes if necessary (according to the
rules used by the C compiler). This behavior is chosen so
that the bytes of a packed struct corresp... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
84a2f9ef-2b8f-4689-95a2-9dd08109a05f | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,703 | supabase-export-v2 | 601d7a4b3819c6d2 | when the format string starts with one of ``'<'``, ``'>'``, ``'!'`` or ``'='``. When using native size, the size of the packed value is platform-dependent.
+--------+--------------------------+--------------------+----------------+------------+
| Format | C Type | Python type | Standard size | Notes |
+========+=======... | trusted_official_docs | CPython Docs | when the format string starts with one of ``'<'``, ``'>'``, ``'!'`` or ``'='``. When using native size, the size of the packed value is platform-dependent.
+--------+--------------------------+--------------------+----------------+------------+
| Format | C Type | Python type | Standard size | Notes |
+========+=======... | when the format string starts with one of ``'<'``, ``'>'``, ``'!'`` or ``'='``. When using native size, the size of the packed value is platform-dependent.
+--------+--------------------------+--------------------+----------------+------------+
| Format | C Type | Python type | Standard size | Notes |
+========+=======... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8d4725e2-1540-4b42-afb3-650d6bdadbd2 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,715 | supabase-export-v2 | 1b21b5c7c6475b44 | the default or with the ``'@'`` byte order character). For the standard size, you can use whichever of the other integer formats fits your application.
(4)
For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed
representation uses the IEEE 754 binary32, binary64 or binary16 format (for
``'f'``, ``'d'`` or... | trusted_official_docs | CPython Docs | the default or with the ``'@'`` byte order character). For the standard size, you can use whichever of the other integer formats fits your application.
(4)
For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed
representation uses the IEEE 754 binary32, binary64 or binary16 format (for
``'f'``, ``'d'`` or... | the default or with the ``'@'`` byte order character). For the standard size, you can use whichever of the other integer formats fits your application.
(4)
For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed
representation uses the IEEE 754 binary32, binary64 or binary16 format (for
``'f'``, ``'d'`` or... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8feb9c63-d8ac-4ca0-bc76-f536b885a8c7 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,684 | supabase-export-v2 | 0293bbdb1fccafbd | none | +-----------+------------------------+----------+-----------+ | ``>`` | big-endian | standard | none | +-----------+------------------------+----------+-----------+ | ``!`` | network (= big-endian) | standard | none | +-----------+------------------------+----------+-----------+
If the first character is not one... | trusted_official_docs | CPython Docs | none | +-----------+------------------------+----------+-----------+ | ``>`` | big-endian | standard | none | +-----------+------------------------+----------+-----------+ | ``!`` | network (= big-endian) | standard | none | +-----------+------------------------+----------+-----------+
If the first character is not one... | none | +-----------+------------------------+----------+-----------+ | ``>`` | big-endian | standard | none | +-----------+------------------------+----------+-----------+ | ``!`` | network (= big-endian) | standard | none | +-----------+------------------------+----------+-----------+
If the first character is not one... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
97d0f5b6-d2ea-46b6-951b-c11e1f767087 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,770 | supabase-export-v2 | 9d97412f97ce2ff3 | .. note::
The compiled versions of the most recent format strings passed to
the module-level functions are cached, so programs that use only a few
format strings needn't worry about reusing a single :class:`Struct`
instance. | trusted_official_docs | CPython Docs | .. note::
The compiled versions of the most recent format strings passed to
the module-level functions are cached, so programs that use only a few
format strings needn't worry about reusing a single :class:`Struct`
instance. | .. note::
The compiled versions of the most recent format strings passed to
the module-level functions are cached, so programs that use only a few
format strings needn't worry about reusing a single :class:`Struct`
instance. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
98ba68e4-aa77-463f-a25a-b4a02fdcc675 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,704 | supabase-export-v2 | a73426d9860217e7 | +--------+--------------------------+--------------------+----------------+------------+ | ``p`` | :c:expr:`char[]` | bytes | | \(8) | +--------+--------------------------+--------------------+----------------+------------+ | ``P`` | :c:expr:`void \*` | int | | \(2), \(5) | +--------+--------------------------+--------... | trusted_official_docs | CPython Docs | +--------+--------------------------+--------------------+----------------+------------+ | ``p`` | :c:expr:`char[]` | bytes | | \(8) | +--------+--------------------------+--------------------+----------------+------------+ | ``P`` | :c:expr:`void \*` | int | | \(2), \(5) | +--------+--------------------------+--------... | +--------+--------------------------+--------------------+----------------+------------+ | ``p`` | :c:expr:`char[]` | bytes | | \(8) | +--------+--------------------------+--------------------+----------------+------------+ | ``P`` | :c:expr:`void \*` | int | | \(2), \(5) | +--------+--------------------------+--------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9da05e79-a7f1-4131-88b8-d0084c8e401e | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,716 | supabase-export-v2 | 2361a7a6fbac65b2 | representation uses the IEEE 754 binary32, binary64 or binary16 format (for ``'f'``, ``'d'`` or ``'e'`` respectively), regardless of the floating-point format used by the platform.
(5)
The ``'P'`` format character is only available for the native byte ordering
(selected as the default or with the ``'@'`` byte order c... | trusted_official_docs | CPython Docs | representation uses the IEEE 754 binary32, binary64 or binary16 format (for ``'f'``, ``'d'`` or ``'e'`` respectively), regardless of the floating-point format used by the platform.
(5)
The ``'P'`` format character is only available for the native byte ordering
(selected as the default or with the ``'@'`` byte order c... | representation uses the IEEE 754 binary32, binary64 or binary16 format (for ``'f'``, ``'d'`` or ``'e'`` respectively), regardless of the floating-point format used by the platform.
(5)
The ``'P'`` format character is only available for the native byte ordering
(selected as the default or with the ``'@'`` byte order c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a20c8172-7eaa-4dc1-9c0c-fe4ca753c0ff | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,694 | supabase-export-v2 | 92d298f343f187ab | Note the difference between ``'@'`` and ``'='``: both use native byte order, but the size and alignment of the latter is standardized.
The form ``'!'`` represents the network byte order which is always big-endian
as defined in `IETF RFC 1700 <IETF RFC 1700_>`_. | trusted_official_docs | CPython Docs | Note the difference between ``'@'`` and ``'='``: both use native byte order, but the size and alignment of the latter is standardized.
The form ``'!'`` represents the network byte order which is always big-endian
as defined in `IETF RFC 1700 <IETF RFC 1700_>`_. | Note the difference between ``'@'`` and ``'='``: both use native byte order, but the size and alignment of the latter is standardized.
The form ``'!'`` represents the network byte order which is always big-endian
as defined in `IETF RFC 1700 <IETF RFC 1700_>`_. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a39a3588-c8a3-4a10-94e8-4f6e9cdf2fcf | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,668 | supabase-export-v2 | f69817ac10dbfbe8 | .. function:: unpack_from(format, /, buffer, offset=0)
Unpack from *buffer* starting at position *offset*, according to the format
string *format*. The result is a tuple even if it contains exactly one
item. The buffer's size in bytes, starting at position *offset*, must be at
least the size required by the format, ... | trusted_official_docs | CPython Docs | .. function:: unpack_from(format, /, buffer, offset=0)
Unpack from *buffer* starting at position *offset*, according to the format
string *format*. The result is a tuple even if it contains exactly one
item. The buffer's size in bytes, starting at position *offset*, must be at
least the size required by the format, ... | .. function:: unpack_from(format, /, buffer, offset=0)
Unpack from *buffer* starting at position *offset*, according to the format
string *format*. The result is a tuple even if it contains exactly one
item. The buffer's size in bytes, starting at position *offset*, must be at
least the size required by the format, ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a69c469d-d185-471a-b9cb-c2d1de5d4994 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,711 | supabase-export-v2 | eb45afb2e54e5960 | (1) .. index:: single: ? (question mark); in struct format strings
The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type
defined by C standards since C99. In standard mode, it is
represented by one byte. | trusted_official_docs | CPython Docs | (1) .. index:: single: ? (question mark); in struct format strings
The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type
defined by C standards since C99. In standard mode, it is
represented by one byte. | (1) .. index:: single: ? (question mark); in struct format strings
The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type
defined by C standards since C99. In standard mode, it is
represented by one byte. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a7e7ab4e-7d0b-4a62-b153-09eea258628a | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,719 | supabase-export-v2 | 60b8b55135275974 | (7) When packing, ``'x'`` inserts one NUL byte.
(8)
The ``'p'`` format character encodes a "Pascal string", meaning a short
variable-length string stored in a *fixed number of bytes*, given by the count. The first byte stored is the length of the string, or 255, whichever is
smaller. The bytes of the string follow. ... | trusted_official_docs | CPython Docs | (7) When packing, ``'x'`` inserts one NUL byte.
(8)
The ``'p'`` format character encodes a "Pascal string", meaning a short
variable-length string stored in a *fixed number of bytes*, given by the count. The first byte stored is the length of the string, or 255, whichever is
smaller. The bytes of the string follow. ... | (7) When packing, ``'x'`` inserts one NUL byte.
(8)
The ``'p'`` format character encodes a "Pascal string", meaning a short
variable-length string stored in a *fixed number of bytes*, given by the count. The first byte stored is the length of the string, or 255, whichever is
smaller. The bytes of the string follow. ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aa83b9dc-339d-41c4-95de-01fe6e0a2ab6 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,718 | supabase-export-v2 | bda3948f67eca802 | can be used for storage, but not for math operations. See the Wikipedia page on the `half-precision floating-point format <half precision format_>`_ for more information.
(7)
When packing, ``'x'`` inserts one NUL byte. | trusted_official_docs | CPython Docs | can be used for storage, but not for math operations. See the Wikipedia page on the `half-precision floating-point format <half precision format_>`_ for more information.
(7)
When packing, ``'x'`` inserts one NUL byte. | can be used for storage, but not for math operations. See the Wikipedia page on the `half-precision floating-point format <half precision format_>`_ for more information.
(7)
When packing, ``'x'`` inserts one NUL byte. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aac24b1d-ecb2-4cbb-9a67-45988a5bb971 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,671 | supabase-export-v2 | 3c64aae44affcebb | its contents have been consumed. The buffer's size in bytes must be a multiple of the size required by the format, as reflected by :func:`calcsize`.
Each iteration yields a tuple as specified by the format string. | trusted_official_docs | CPython Docs | its contents have been consumed. The buffer's size in bytes must be a multiple of the size required by the format, as reflected by :func:`calcsize`.
Each iteration yields a tuple as specified by the format string. | its contents have been consumed. The buffer's size in bytes must be a multiple of the size required by the format, as reflected by :func:`calcsize`.
Each iteration yields a tuple as specified by the format string. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ac57e01e-916e-40a4-9e85-f0b47e1d31c0 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,787 | supabase-export-v2 | b50236680a51faa8 | The calculated size of the struct (and hence of the bytes object produced by the :meth:`pack` method) corresponding to :attr:`format`.
.. versionchanged:: 3.13 The *repr()* of structs has changed. It
is now: | trusted_official_docs | CPython Docs | The calculated size of the struct (and hence of the bytes object produced by the :meth:`pack` method) corresponding to :attr:`format`.
.. versionchanged:: 3.13 The *repr()* of structs has changed. It
is now: | The calculated size of the struct (and hence of the bytes object produced by the :meth:`pack` method) corresponding to :attr:`format`.
.. versionchanged:: 3.13 The *repr()* of structs has changed. It
is now: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b312bab0-41b2-4b7f-a66c-c0cc9ac2dd73 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,740 | supabase-export-v2 | 09977b34ed1bc6c2 | >>> from collections import namedtuple >>> Student = namedtuple('Student', 'name serialnum school gradelevel') >>> Student._make(unpack('<10sHHb', record)) Student(name=b'raymond ', serialnum=4658, school=264, gradelevel=8)
The ordering of format characters may have an impact on size in native
mode since padding is imp... | trusted_official_docs | CPython Docs | >>> from collections import namedtuple >>> Student = namedtuple('Student', 'name serialnum school gradelevel') >>> Student._make(unpack('<10sHHb', record)) Student(name=b'raymond ', serialnum=4658, school=264, gradelevel=8)
The ordering of format characters may have an impact on size in native
mode since padding is imp... | >>> from collections import namedtuple >>> Student = namedtuple('Student', 'name serialnum school gradelevel') >>> Student._make(unpack('<10sHHb', record)) Student(name=b'raymond ', serialnum=4658, school=264, gradelevel=8)
The ordering of format characters may have an impact on size in native
mode since padding is imp... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b6dc6ce0-c4b5-4e92-a0e8-43e7b453f118 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,653 | supabase-export-v2 | 90760c40ba64c362 | --------------
This module converts between Python values and C structs represented
as Python :class:`bytes` objects. Compact :ref:`format strings <struct-format-strings>`
describe the intended conversions to/from Python values. The module's functions and objects can be used for two largely
distinct applications, data ... | trusted_official_docs | CPython Docs | --------------
This module converts between Python values and C structs represented
as Python :class:`bytes` objects. Compact :ref:`format strings <struct-format-strings>`
describe the intended conversions to/from Python values. The module's functions and objects can be used for two largely
distinct applications, data ... | --------------
This module converts between Python values and C structs represented
as Python :class:`bytes` objects. Compact :ref:`format strings <struct-format-strings>`
describe the intended conversions to/from Python values. The module's functions and objects can be used for two largely
distinct applications, data ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ba7d4e9b-298b-4386-9fd2-16d5e4a367f9 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,714 | supabase-export-v2 | fcb549e3c4da113d | .. versionchanged:: 3.2 Added use of the :meth:`~object.__index__` method for non-integers.
(3)
The ``'n'`` and ``'N'`` conversion codes are only available for the native
size (selected as the default or with the ``'@'`` byte order character). For the standard size, you can use whichever of the other integer formats
... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.2 Added use of the :meth:`~object.__index__` method for non-integers.
(3)
The ``'n'`` and ``'N'`` conversion codes are only available for the native
size (selected as the default or with the ``'@'`` byte order character). For the standard size, you can use whichever of the other integer formats
... | .. versionchanged:: 3.2 Added use of the :meth:`~object.__index__` method for non-integers.
(3)
The ``'n'`` and ``'N'`` conversion codes are only available for the native
size (selected as the default or with the ``'@'`` byte order character). For the standard size, you can use whichever of the other integer formats
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bb82dd73-c4f6-466a-83e4-ec57dea147d5 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,683 | supabase-export-v2 | b6c083e4fe8adb0e | character of the format string can be used to indicate the byte order, size and alignment of the packed data, according to the following table:
+-----------+------------------------+----------+-----------+
| Character | Byte order | Size | Alignment |
+===========+========================+==========+===========+
| ``@`... | trusted_official_docs | CPython Docs | character of the format string can be used to indicate the byte order, size and alignment of the packed data, according to the following table:
+-----------+------------------------+----------+-----------+
| Character | Byte order | Size | Alignment |
+===========+========================+==========+===========+
| ``@`... | character of the format string can be used to indicate the byte order, size and alignment of the packed data, according to the following table:
+-----------+------------------------+----------+-----------+
| Character | Byte order | Size | Alignment |
+===========+========================+==========+===========+
| ``@`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c27090d5-bb1d-40b1-a65d-43605c468bac | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,738 | supabase-export-v2 | 55b976e0815d2f90 | Unpacked fields can be named by assigning them to variables or by wrapping the result in a named tuple::
>>> record = b'raymond \x32\x12\x08\x01\x08'
>>> name, serialnum, school, gradelevel = unpack('<10sHHb', record) | trusted_official_docs | CPython Docs | Unpacked fields can be named by assigning them to variables or by wrapping the result in a named tuple::
>>> record = b'raymond \x32\x12\x08\x01\x08'
>>> name, serialnum, school, gradelevel = unpack('<10sHHb', record) | Unpacked fields can be named by assigning them to variables or by wrapping the result in a named tuple::
>>> record = b'raymond \x32\x12\x08\x01\x08'
>>> name, serialnum, school, gradelevel = unpack('<10sHHb', record) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c356c482-7a97-418f-b389-ebd7bf42b008 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,768 | supabase-export-v2 | 5c1bd97806171161 | .. class:: Struct(format)
Return a new Struct object which writes and reads binary data according to
the format string *format*. Creating a ``Struct`` object once and calling its
methods is more efficient than calling module-level functions with the
same format since the format string is only compiled once. | trusted_official_docs | CPython Docs | .. class:: Struct(format)
Return a new Struct object which writes and reads binary data according to
the format string *format*. Creating a ``Struct`` object once and calling its
methods is more efficient than calling module-level functions with the
same format since the format string is only compiled once. | .. class:: Struct(format)
Return a new Struct object which writes and reads binary data according to
the format string *format*. Creating a ``Struct`` object once and calling its
methods is more efficient than calling module-level functions with the
same format since the format string is only compiled once. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c3ccc76b-3e40-434e-a592-5e62f5ccd2d1 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,713 | supabase-export-v2 | 248b1c46d8e06072 | the integer conversion codes, if the non-integer has a :meth:`~object.__index__` method then that method is called to convert the argument to an integer before packing.
.. versionchanged:: 3.2
Added use of the :meth:`~object.__index__` method for non-integers. | trusted_official_docs | CPython Docs | the integer conversion codes, if the non-integer has a :meth:`~object.__index__` method then that method is called to convert the argument to an integer before packing.
.. versionchanged:: 3.2
Added use of the :meth:`~object.__index__` method for non-integers. | the integer conversion codes, if the non-integer has a :meth:`~object.__index__` method then that method is called to convert the argument to an integer before packing.
.. versionchanged:: 3.2
Added use of the :meth:`~object.__index__` method for non-integers. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c793a137-1462-4e99-a919-b2509c435f6b | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,692 | supabase-export-v2 | a8bd781a93bfaa79 | Native size and alignment are determined using the C compiler's ``sizeof`` expression. This is always combined with native byte order.
Standard size depends only on the format character; see the table in
the :ref:`format-characters` section. | trusted_official_docs | CPython Docs | Native size and alignment are determined using the C compiler's ``sizeof`` expression. This is always combined with native byte order.
Standard size depends only on the format character; see the table in
the :ref:`format-characters` section. | Native size and alignment are determined using the C compiler's ``sizeof`` expression. This is always combined with native byte order.
Standard size depends only on the format character; see the table in
the :ref:`format-characters` section. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cb7ee161-09c8-42ba-af56-206547b43df8 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,702 | supabase-export-v2 | 2d9601c121a1c030 | Format Characters ^^^^^^^^^^^^^^^^^
Format characters have the following meaning; the conversion between C and
Python values should be obvious given their types. The 'Standard size' column
refers to the size of the packed value in bytes when using standard size; that
is, when the format string starts with one of ``'<'`... | trusted_official_docs | CPython Docs | Format Characters ^^^^^^^^^^^^^^^^^
Format characters have the following meaning; the conversion between C and
Python values should be obvious given their types. The 'Standard size' column
refers to the size of the packed value in bytes when using standard size; that
is, when the format string starts with one of ``'<'`... | Format Characters ^^^^^^^^^^^^^^^^^
Format characters have the following meaning; the conversion between C and
Python values should be obvious given their types. The 'Standard size' column
refers to the size of the packed value in bytes when using standard size; that
is, when the format string starts with one of ``'<'`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d0d0e3df-6b87-4599-b2e7-cfa77fedd0cc | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,734 | supabase-export-v2 | d0c77e50e42ab3ff | Attempt to pack an integer which is too large for the defined field::
>>> pack(">h", 99999)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
struct.error: 'h' format requires -32768 <= number <= 32767 | trusted_official_docs | CPython Docs | Attempt to pack an integer which is too large for the defined field::
>>> pack(">h", 99999)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
struct.error: 'h' format requires -32768 <= number <= 32767 | Attempt to pack an integer which is too large for the defined field::
>>> pack(">h", 99999)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
struct.error: 'h' format requires -32768 <= number <= 32767 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d3542340-c643-4395-8826-fec78a520a88 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,670 | supabase-export-v2 | 097d46642ad5d992 | .. function:: iter_unpack(format, buffer)
Iteratively unpack from the buffer *buffer* according to the format
string *format*. This function returns an iterator which will read
equally sized chunks from the buffer until all its contents have been
consumed. The buffer's size in bytes must be a multiple of the size
r... | trusted_official_docs | CPython Docs | .. function:: iter_unpack(format, buffer)
Iteratively unpack from the buffer *buffer* according to the format
string *format*. This function returns an iterator which will read
equally sized chunks from the buffer until all its contents have been
consumed. The buffer's size in bytes must be a multiple of the size
r... | .. function:: iter_unpack(format, buffer)
Iteratively unpack from the buffer *buffer* according to the format
string *format*. This function returns an iterator which will read
equally sized chunks from the buffer until all its contents have been
consumed. The buffer's size in bytes must be a multiple of the size
r... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d395e3f0-f966-49f2-b332-995a6d1d3966 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,731 | supabase-export-v2 | 683f62686c37c13d | ``'@'`` format prefix or lack of any prefix character) may not match what the reader's machine produces as that depends on the platform and compiler.
Pack and unpack integers of three different sizes, using big endian
ordering:: | trusted_official_docs | CPython Docs | ``'@'`` format prefix or lack of any prefix character) may not match what the reader's machine produces as that depends on the platform and compiler.
Pack and unpack integers of three different sizes, using big endian
ordering:: | ``'@'`` format prefix or lack of any prefix character) may not match what the reader's machine produces as that depends on the platform and compiler.
Pack and unpack integers of three different sizes, using big endian
ordering:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d6ecc03d-a741-4994-b2fd-32f5961b4ed2 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,733 | supabase-export-v2 | eebee22622209609 | >>> from struct import * >>> pack(">bhl", 1, 2, 3) b'\x01\x00\x02\x00\x00\x00\x03' >>> unpack('>bhl', b'\x01\x00\x02\x00\x00\x00\x03') (1, 2, 3) >>> calcsize('>bhl') 7
Attempt to pack an integer which is too large for the defined field:: | trusted_official_docs | CPython Docs | >>> from struct import * >>> pack(">bhl", 1, 2, 3) b'\x01\x00\x02\x00\x00\x00\x03' >>> unpack('>bhl', b'\x01\x00\x02\x00\x00\x00\x03') (1, 2, 3) >>> calcsize('>bhl') 7
Attempt to pack an integer which is too large for the defined field:: | >>> from struct import * >>> pack(">bhl", 1, 2, 3) b'\x01\x00\x02\x00\x00\x00\x03' >>> unpack('>bhl', b'\x01\x00\x02\x00\x00\x00\x03') (1, 2, 3) >>> calcsize('>bhl') 7
Attempt to pack an integer which is too large for the defined field:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d91098b3-fcc7-4ee3-aa21-2357ee95d7a7 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,721 | supabase-export-v2 | 9749b82cdcb0ca3d | object always has exactly the specified number of bytes. As a special case, ``'0s'`` means a single, empty byte string (while ``'0c'`` means 0 characters).
When packing, arguments of types :class:`bytes` and :class:`bytearray`
are accepted. | trusted_official_docs | CPython Docs | object always has exactly the specified number of bytes. As a special case, ``'0s'`` means a single, empty byte string (while ``'0c'`` means 0 characters).
When packing, arguments of types :class:`bytes` and :class:`bytearray`
are accepted. | object always has exactly the specified number of bytes. As a special case, ``'0s'`` means a single, empty byte string (while ``'0c'`` means 0 characters).
When packing, arguments of types :class:`bytes` and :class:`bytearray`
are accepted. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
da258e71-436a-46c8-9dc1-4205e22f8a14 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,667 | supabase-export-v2 | 878e38dfb37a53ac | tuple even if it contains exactly one item. The buffer's size in bytes must match the size required by the format, as reflected by :func:`calcsize`.
.. function:: unpack_from(format, /, buffer, offset=0) | trusted_official_docs | CPython Docs | tuple even if it contains exactly one item. The buffer's size in bytes must match the size required by the format, as reflected by :func:`calcsize`.
.. function:: unpack_from(format, /, buffer, offset=0) | tuple even if it contains exactly one item. The buffer's size in bytes must match the size required by the format, as reflected by :func:`calcsize`.
.. function:: unpack_from(format, /, buffer, offset=0) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e3cff4ea-3db9-45ff-864a-fbcfc3471c7e | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,735 | supabase-export-v2 | 6f068b5ecceead91 | >>> pack(">h", 99999) Traceback (most recent call last): File "<stdin>", line 1, in <module> struct.error: 'h' format requires -32768 <= number <= 32767
Demonstrate the difference between ``'s'`` and ``'c'`` format
characters:: | trusted_official_docs | CPython Docs | >>> pack(">h", 99999) Traceback (most recent call last): File "<stdin>", line 1, in <module> struct.error: 'h' format requires -32768 <= number <= 32767
Demonstrate the difference between ``'s'`` and ``'c'`` format
characters:: | >>> pack(">h", 99999) Traceback (most recent call last): File "<stdin>", line 1, in <module> struct.error: 'h' format requires -32768 <= number <= 32767
Demonstrate the difference between ``'s'`` and ``'c'`` format
characters:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f67769c5-5571-4d54-8600-4355611c7419 | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,732 | supabase-export-v2 | 00d493bd07261656 | Pack and unpack integers of three different sizes, using big endian ordering::
>>> from struct import *
>>> pack(">bhl", 1, 2, 3)
b'\x01\x00\x02\x00\x00\x00\x03'
>>> unpack('>bhl', b'\x01\x00\x02\x00\x00\x00\x03')
(1, 2, 3)
>>> calcsize('>bhl')
7 | trusted_official_docs | CPython Docs | Pack and unpack integers of three different sizes, using big endian ordering::
>>> from struct import *
>>> pack(">bhl", 1, 2, 3)
b'\x01\x00\x02\x00\x00\x00\x03'
>>> unpack('>bhl', b'\x01\x00\x02\x00\x00\x00\x03')
(1, 2, 3)
>>> calcsize('>bhl')
7 | Pack and unpack integers of three different sizes, using big endian ordering::
>>> from struct import *
>>> pack(">bhl", 1, 2, 3)
b'\x01\x00\x02\x00\x00\x00\x03'
>>> unpack('>bhl', b'\x01\x00\x02\x00\x00\x00\x03')
(1, 2, 3)
>>> calcsize('>bhl')
7 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ffd83db5-1d6f-4fc9-893a-83dc073ce9fb | CPython Docs | file://datasets/cpython/Doc/library/struct.rst | unknown | 2b254f62-3731-4466-bd26-d385fbd9a112 | 9,728 | supabase-export-v2 | fb448f1774aeb184 | .. index:: single: ? (question mark); in struct format strings
For the ``'?'`` format character, the return value is either :const:`True` or
:const:`False`. When packing, the truth value of the argument object is used. Either 0 or 1 in the native or standard bool representation will be packed, and
any non-zero value wi... | trusted_official_docs | CPython Docs | .. index:: single: ? (question mark); in struct format strings
For the ``'?'`` format character, the return value is either :const:`True` or
:const:`False`. When packing, the truth value of the argument object is used. Either 0 or 1 in the native or standard bool representation will be packed, and
any non-zero value wi... | .. index:: single: ? (question mark); in struct format strings
For the ``'?'`` format character, the return value is either :const:`True` or
:const:`False`. When packing, the truth value of the argument object is used. Either 0 or 1 in the native or standard bool representation will be packed, and
any non-zero value wi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
70291132-5eef-4f5a-ab27-68db8b621176 | CPython Docs | file://datasets/cpython/Doc/library/colorsys.rst | unknown | def9781d-6614-48b0-a0db-33dea3377e42 | 9,796 | supabase-export-v2 | ccdff78da0c47908 | --------------
The :mod:`!colorsys` module defines bidirectional conversions of color values
between colors expressed in the RGB (Red Green Blue) color space used in
computer monitors and three other coordinate systems: YIQ, HLS (Hue Lightness
Saturation) and HSV (Hue Saturation Value). Coordinates in all of these colo... | trusted_official_docs | CPython Docs | --------------
The :mod:`!colorsys` module defines bidirectional conversions of color values
between colors expressed in the RGB (Red Green Blue) color space used in
computer monitors and three other coordinate systems: YIQ, HLS (Hue Lightness
Saturation) and HSV (Hue Saturation Value). Coordinates in all of these colo... | --------------
The :mod:`!colorsys` module defines bidirectional conversions of color values
between colors expressed in the RGB (Red Green Blue) color space used in
computer monitors and three other coordinate systems: YIQ, HLS (Hue Lightness
Saturation) and HSV (Hue Saturation Value). Coordinates in all of these colo... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
08825a50-9fc2-4179-9722-5202bb881a9c | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,902 | supabase-export-v2 | e87b34066bebbabc | Turning events on and off -------------------------
In order to monitor an event, it must be turned on and a corresponding callback
must be registered. Events can be turned on or off by setting the events either
globally and/or for a particular code object. An event will trigger only once,
even if it is turned on both ... | trusted_official_docs | CPython Docs | Turning events on and off -------------------------
In order to monitor an event, it must be turned on and a corresponding callback
must be registered. Events can be turned on or off by setting the events either
globally and/or for a particular code object. An event will trigger only once,
even if it is turned on both ... | Turning events on and off -------------------------
In order to monitor an event, it must be turned on and a corresponding callback
must be registered. Events can be turned on or off by setting the events either
globally and/or for a particular code object. An event will trigger only once,
even if it is turned on both ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0a4d490f-a5bf-4a3e-86d0-3ac4690eec0c | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,915 | supabase-export-v2 | 6cb7d8a7f5234967 | .. function:: set_local_events(tool_id: int, code: CodeType, event_set: int, /) -> None
Activates all the :ref:`local events <monitoring-event-local>` for *code*
which are set in *event_set*. Raises a :exc:`ValueError` if *tool_id* is not
in use. | trusted_official_docs | CPython Docs | .. function:: set_local_events(tool_id: int, code: CodeType, event_set: int, /) -> None
Activates all the :ref:`local events <monitoring-event-local>` for *code*
which are set in *event_set*. Raises a :exc:`ValueError` if *tool_id* is not
in use. | .. function:: set_local_events(tool_id: int, code: CodeType, event_set: int, /) -> None
Activates all the :ref:`local events <monitoring-event-local>` for *code*
which are set in *event_set*. Raises a :exc:`ValueError` if *tool_id* is not
in use. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
10fc3f54-9729-47b1-b170-73a57fb38e2a | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,827 | supabase-export-v2 | 7066145f94a6bf49 | .. function:: use_tool_id(tool_id: int, name: str, /) -> None
Must be called before *tool_id* can be used. *tool_id* must be in the range 0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use. | trusted_official_docs | CPython Docs | .. function:: use_tool_id(tool_id: int, name: str, /) -> None
Must be called before *tool_id* can be used. *tool_id* must be in the range 0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use. | .. function:: use_tool_id(tool_id: int, name: str, /) -> None
Must be called before *tool_id* can be used. *tool_id* must be in the range 0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2169657e-a712-4b9f-a3c2-90a93bff12e0 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,835 | supabase-export-v2 | 7899fe2107e16222 | All IDs are treated the same by the VM with regard to events, but the following IDs are pre-defined to make co-operation of tools easier::
sys.monitoring.DEBUGGER_ID = 0
sys.monitoring.COVERAGE_ID = 1
sys.monitoring.PROFILER_ID = 2
sys.monitoring.OPTIMIZER_ID = 5 | trusted_official_docs | CPython Docs | All IDs are treated the same by the VM with regard to events, but the following IDs are pre-defined to make co-operation of tools easier::
sys.monitoring.DEBUGGER_ID = 0
sys.monitoring.COVERAGE_ID = 1
sys.monitoring.PROFILER_ID = 2
sys.monitoring.OPTIMIZER_ID = 5 | All IDs are treated the same by the VM with regard to events, but the following IDs are pre-defined to make co-operation of tools easier::
sys.monitoring.DEBUGGER_ID = 0
sys.monitoring.COVERAGE_ID = 1
sys.monitoring.PROFILER_ID = 2
sys.monitoring.OPTIMIZER_ID = 5 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e6e586f-ea24-4ab5-8442-ddfd95709ca2 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,912 | supabase-export-v2 | 5c93991307151353 | functions defined below which accept a :class:`types.CodeType` should be prepared to accept a look-alike object from functions which are not defined in Python (see :ref:`c-api-monitoring`).
.. function:: get_local_events(tool_id: int, code: CodeType, /) -> int | trusted_official_docs | CPython Docs | functions defined below which accept a :class:`types.CodeType` should be prepared to accept a look-alike object from functions which are not defined in Python (see :ref:`c-api-monitoring`).
.. function:: get_local_events(tool_id: int, code: CodeType, /) -> int | functions defined below which accept a :class:`types.CodeType` should be prepared to accept a look-alike object from functions which are not defined in Python (see :ref:`c-api-monitoring`).
.. function:: get_local_events(tool_id: int, code: CodeType, /) -> int | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
322a2b37-8205-4b5d-a8dc-1c1b1876c3e0 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,898 | supabase-export-v2 | bbdab0f76270c65e | The STOP_ITERATION event ''''''''''''''''''''''''
:pep:`PEP 380 <380#use-of-stopiteration-to-return-values>`
specifies that a :exc:`StopIteration` exception is raised when returning a value
from a generator or coroutine. However, this is a very inefficient way to
return a value, so some Python implementations, notably ... | trusted_official_docs | CPython Docs | The STOP_ITERATION event ''''''''''''''''''''''''
:pep:`PEP 380 <380#use-of-stopiteration-to-return-values>`
specifies that a :exc:`StopIteration` exception is raised when returning a value
from a generator or coroutine. However, this is a very inefficient way to
return a value, so some Python implementations, notably ... | The STOP_ITERATION event ''''''''''''''''''''''''
:pep:`PEP 380 <380#use-of-stopiteration-to-return-values>`
specifies that a :exc:`StopIteration` exception is raised when returning a value
from a generator or coroutine. However, this is a very inefficient way to
return a value, so some Python implementations, notably ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
386ff90c-f356-4693-b736-9b3c819342fd | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,932 | supabase-export-v2 | ab6ca286df952d01 | Callback functions can be registered and unregistered at any time.
Callbacks are called only once regardless if the event is turned on both
globally and locally. As such, if an event could be turned on for both global
and local events by your code then the callback needs to be written to handle
either trigger. | trusted_official_docs | CPython Docs | Callback functions can be registered and unregistered at any time.
Callbacks are called only once regardless if the event is turned on both
globally and locally. As such, if an event could be turned on for both global
and local events by your code then the callback needs to be written to handle
either trigger. | Callback functions can be registered and unregistered at any time.
Callbacks are called only once regardless if the event is turned on both
globally and locally. As such, if an event could be turned on for both global
and local events by your code then the callback needs to be written to handle
either trigger. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3c1422e5-2567-4524-80e6-e76e5f5fb72b | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,921 | supabase-export-v2 | a5f77dde46ae73b6 | a per code object basis by returning :data:`sys.monitoring.DISABLE` from a callback function. This disables the event for the entire code object (for the current tool).
Disabling events for specific locations is very important for high performance
monitoring. For example, a program can be run under a debugger with no o... | trusted_official_docs | CPython Docs | a per code object basis by returning :data:`sys.monitoring.DISABLE` from a callback function. This disables the event for the entire code object (for the current tool).
Disabling events for specific locations is very important for high performance
monitoring. For example, a program can be run under a debugger with no o... | a per code object basis by returning :data:`sys.monitoring.DISABLE` from a callback function. This disables the event for the entire code object (for the current tool).
Disabling events for specific locations is very important for high performance
monitoring. For example, a program can be run under a debugger with no o... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3e82d27e-3188-4b18-96a0-8130b760f6b7 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,820 | supabase-export-v2 | 6a5401cf6e11e468 | events occur that might be of interest to tools that monitor execution. The :mod:`!sys.monitoring` namespace provides means to receive callbacks when events of interest occur.
The monitoring API consists of three components: | trusted_official_docs | CPython Docs | events occur that might be of interest to tools that monitor execution. The :mod:`!sys.monitoring` namespace provides means to receive callbacks when events of interest occur.
The monitoring API consists of three components: | events occur that might be of interest to tools that monitor execution. The :mod:`!sys.monitoring` namespace provides means to receive callbacks when events of interest occur.
The monitoring API consists of three components: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4c20db99-e356-4bec-9006-3ea0ed235449 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,833 | supabase-export-v2 | a1a46c447d07b2bc | .. function:: get_tool(tool_id: int, /) -> str | None
Returns the name of the tool if *tool_id* is in use,
otherwise it returns ``None``. *tool_id* must be in the range 0 to 5 inclusive. | trusted_official_docs | CPython Docs | .. function:: get_tool(tool_id: int, /) -> str | None
Returns the name of the tool if *tool_id* is in use,
otherwise it returns ``None``. *tool_id* must be in the range 0 to 5 inclusive. | .. function:: get_tool(tool_id: int, /) -> str | None
Returns the name of the tool if *tool_id* is in use,
otherwise it returns ``None``. *tool_id* must be in the range 0 to 5 inclusive. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5acdc413-be2e-4959-9c85-105797479cc7 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,911 | supabase-export-v2 | 787d1205d5d0e259 | Per code object events ''''''''''''''''''''''
Events can also be controlled on a per code object basis. The functions
defined below which accept a :class:`types.CodeType` should be prepared
to accept a look-alike object from functions which are not defined
in Python (see :ref:`c-api-monitoring`). | trusted_official_docs | CPython Docs | Per code object events ''''''''''''''''''''''
Events can also be controlled on a per code object basis. The functions
defined below which accept a :class:`types.CodeType` should be prepared
to accept a look-alike object from functions which are not defined
in Python (see :ref:`c-api-monitoring`). | Per code object events ''''''''''''''''''''''
Events can also be controlled on a per code object basis. The functions
defined below which accept a :class:`types.CodeType` should be prepared
to accept a look-alike object from functions which are not defined
in Python (see :ref:`c-api-monitoring`). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5cb18fd1-8b32-4bc6-ad23-676f242e168f | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,899 | supabase-export-v2 | 57336fac750779a9 | way to return a value, so some Python implementations, notably CPython 3.12+, do not raise an exception unless it would be visible to other code.
To allow tools to monitor for real exceptions without slowing down generators
and coroutines, the :monitoring-event:`STOP_ITERATION` event is provided. :monitoring-event:`STO... | trusted_official_docs | CPython Docs | way to return a value, so some Python implementations, notably CPython 3.12+, do not raise an exception unless it would be visible to other code.
To allow tools to monitor for real exceptions without slowing down generators
and coroutines, the :monitoring-event:`STOP_ITERATION` event is provided. :monitoring-event:`STO... | way to return a value, so some Python implementations, notably CPython 3.12+, do not raise an exception unless it would be visible to other code.
To allow tools to monitor for real exceptions without slowing down generators
and coroutines, the :monitoring-event:`STOP_ITERATION` event is provided. :monitoring-event:`STO... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
729e2b3e-adc5-4cca-8c16-0d42c0c195d4 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,928 | supabase-export-v2 | 89d2be74833e981f | Registers the callable *func* for the *event* with the given *tool_id*
If another callback was registered for the given *tool_id* and *event*,
it is unregistered and returned. Otherwise :func:`register_callback` returns ``None``. | trusted_official_docs | CPython Docs | Registers the callable *func* for the *event* with the given *tool_id*
If another callback was registered for the given *tool_id* and *event*,
it is unregistered and returned. Otherwise :func:`register_callback` returns ``None``. | Registers the callable *func* for the *event* with the given *tool_id*
If another callback was registered for the given *tool_id* and *event*,
it is unregistered and returned. Otherwise :func:`register_callback` returns ``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7b7dfabf-3a69-45d1-a308-64d2261f4da5 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,883 | supabase-export-v2 | 84fe8aa78938ba33 | associated with normal execution of the program and happen at clearly defined locations. All local events can be disabled per location. The local events are:
* :monitoring-event:`PY_START`
* :monitoring-event:`PY_RESUME`
* :monitoring-event:`PY_RETURN`
* :monitoring-event:`PY_YIELD`
* :monitoring-event:`CALL`
* :monito... | trusted_official_docs | CPython Docs | associated with normal execution of the program and happen at clearly defined locations. All local events can be disabled per location. The local events are:
* :monitoring-event:`PY_START`
* :monitoring-event:`PY_RESUME`
* :monitoring-event:`PY_RETURN`
* :monitoring-event:`PY_YIELD`
* :monitoring-event:`CALL`
* :monito... | associated with normal execution of the program and happen at clearly defined locations. All local events can be disabled per location. The local events are:
* :monitoring-event:`PY_START`
* :monitoring-event:`PY_RESUME`
* :monitoring-event:`PY_RETURN`
* :monitoring-event:`PY_YIELD`
* :monitoring-event:`CALL`
* :monito... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
87160a94-bd19-4772-a228-caee6d548e13 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,901 | supabase-export-v2 | 4563af08b306a48a | equivalent, and are treated as interchangeable when generating events. Implementations will favor :monitoring-event:`STOP_ITERATION` for performance reasons, but may generate a :monitoring-event:`RAISE` event with a :exc:`StopIteration`.
Turning events on and off
------------------------- | trusted_official_docs | CPython Docs | equivalent, and are treated as interchangeable when generating events. Implementations will favor :monitoring-event:`STOP_ITERATION` for performance reasons, but may generate a :monitoring-event:`RAISE` event with a :exc:`StopIteration`.
Turning events on and off
------------------------- | equivalent, and are treated as interchangeable when generating events. Implementations will favor :monitoring-event:`STOP_ITERATION` for performance reasons, but may generate a :monitoring-event:`RAISE` event with a :exc:`StopIteration`.
Turning events on and off
------------------------- | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8fb00c8b-2899-443a-9a3f-89ebdbc7e927 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,834 | supabase-export-v2 | e880445e2162d709 | Returns the name of the tool if *tool_id* is in use, otherwise it returns ``None``. *tool_id* must be in the range 0 to 5 inclusive.
All IDs are treated the same by the VM with regard to events, but the
following IDs are pre-defined to make co-operation of tools easier:: | trusted_official_docs | CPython Docs | Returns the name of the tool if *tool_id* is in use, otherwise it returns ``None``. *tool_id* must be in the range 0 to 5 inclusive.
All IDs are treated the same by the VM with regard to events, but the
following IDs are pre-defined to make co-operation of tools easier:: | Returns the name of the tool if *tool_id* is in use, otherwise it returns ``None``. *tool_id* must be in the range 0 to 5 inclusive.
All IDs are treated the same by the VM with regard to events, but the
following IDs are pre-defined to make co-operation of tools easier:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
94232f7a-038f-408f-a0c8-c5e6138ef269 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,890 | supabase-export-v2 | dada4708dad6aae1 | * :monitoring-event:`C_RAISE` * :monitoring-event:`C_RETURN`
The :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events
are controlled by the :monitoring-event:`CALL` event. :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events will only be
seen if the corresponding :monitoring-event:`CALL` e... | trusted_official_docs | CPython Docs | * :monitoring-event:`C_RAISE` * :monitoring-event:`C_RETURN`
The :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events
are controlled by the :monitoring-event:`CALL` event. :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events will only be
seen if the corresponding :monitoring-event:`CALL` e... | * :monitoring-event:`C_RAISE` * :monitoring-event:`C_RETURN`
The :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events
are controlled by the :monitoring-event:`CALL` event. :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events will only be
seen if the corresponding :monitoring-event:`CALL` e... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9433080a-0896-437f-9247-4e98fd16005b | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,945 | supabase-export-v2 | c6cae92c13f42efe | methods, *callable* will be the function object as found on the class with *arg0* set to the instance (i.e. the ``self`` argument to the method).
* :monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-event:`EXCEPTION_HANDLED`,
:monitoring-event:`PY_UNWIND`, :monitoring-event:`PY_THROW` and :monitoring-... | trusted_official_docs | CPython Docs | methods, *callable* will be the function object as found on the class with *arg0* set to the instance (i.e. the ``self`` argument to the method).
* :monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-event:`EXCEPTION_HANDLED`,
:monitoring-event:`PY_UNWIND`, :monitoring-event:`PY_THROW` and :monitoring-... | methods, *callable* will be the function object as found on the class with *arg0* set to the instance (i.e. the ``self`` argument to the method).
* :monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-event:`EXCEPTION_HANDLED`,
:monitoring-event:`PY_UNWIND`, :monitoring-event:`PY_THROW` and :monitoring-... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
969a23fb-4222-44f9-8fee-30a4da5b9a26 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,818 | supabase-export-v2 | cf86a4b8a2dfd979 | namespace within the :mod:`sys` module, not an independent module, and ``import sys.monitoring`` would fail with a :exc:`ModuleNotFoundError`. Instead, simply ``import sys`` and then use ``sys.monitoring``.
This namespace provides access to the functions and constants necessary to
activate and control event monitoring. | trusted_official_docs | CPython Docs | namespace within the :mod:`sys` module, not an independent module, and ``import sys.monitoring`` would fail with a :exc:`ModuleNotFoundError`. Instead, simply ``import sys`` and then use ``sys.monitoring``.
This namespace provides access to the functions and constants necessary to
activate and control event monitoring. | namespace within the :mod:`sys` module, not an independent module, and ``import sys.monitoring`` would fail with a :exc:`ModuleNotFoundError`. Instead, simply ``import sys`` and then use ``sys.monitoring``.
This namespace provides access to the functions and constants necessary to
activate and control event monitoring. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9e1cfcf5-5939-470d-90ab-c372371b33c7 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,896 | supabase-export-v2 | db22833b0737995d | * :monitoring-event:`PY_THROW` * :monitoring-event:`PY_UNWIND` * :monitoring-event:`RAISE` * :monitoring-event:`EXCEPTION_HANDLED` * :monitoring-event:`RERAISE`
.. versionchanged:: 3.15
Other events can now be turned on and disabled on a per code object
basis. Returning :data:`DISABLE` from a callback disables the ev... | trusted_official_docs | CPython Docs | * :monitoring-event:`PY_THROW` * :monitoring-event:`PY_UNWIND` * :monitoring-event:`RAISE` * :monitoring-event:`EXCEPTION_HANDLED` * :monitoring-event:`RERAISE`
.. versionchanged:: 3.15
Other events can now be turned on and disabled on a per code object
basis. Returning :data:`DISABLE` from a callback disables the ev... | * :monitoring-event:`PY_THROW` * :monitoring-event:`PY_UNWIND` * :monitoring-event:`RAISE` * :monitoring-event:`EXCEPTION_HANDLED` * :monitoring-event:`RERAISE`
.. versionchanged:: 3.15
Other events can now be turned on and disabled on a per code object
basis. Returning :data:`DISABLE` from a callback disables the ev... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a3656aab-1de2-48e5-9652-299e332a1ba9 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,824 | supabase-export-v2 | e24808b8a7b98d6f | at the same time. Currently tools are completely independent and cannot be used to monitor each other. This restriction may be lifted in the future.
Before registering or activating events, a tool should choose an identifier. Identifiers are integers in the range 0 to 5 inclusive. | trusted_official_docs | CPython Docs | at the same time. Currently tools are completely independent and cannot be used to monitor each other. This restriction may be lifted in the future.
Before registering or activating events, a tool should choose an identifier. Identifiers are integers in the range 0 to 5 inclusive. | at the same time. Currently tools are completely independent and cannot be used to monitor each other. This restriction may be lifted in the future.
Before registering or activating events, a tool should choose an identifier. Identifiers are integers in the range 0 to 5 inclusive. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a6b6ee75-7a0e-4b37-9883-cace8aaad08e | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,882 | supabase-export-v2 | 76218fd886848015 | Local events ''''''''''''
Local events are associated with normal execution of the program and happen
at clearly defined locations. All local events can be disabled
per location. The local events are: | trusted_official_docs | CPython Docs | Local events ''''''''''''
Local events are associated with normal execution of the program and happen
at clearly defined locations. All local events can be disabled
per location. The local events are: | Local events ''''''''''''
Local events are associated with normal execution of the program and happen
at clearly defined locations. All local events can be disabled
per location. The local events are: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ad5bcbed-f175-4080-a78c-110eb5049c57 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,900 | supabase-export-v2 | 8856ac753396923b | To allow tools to monitor for real exceptions without slowing down generators and coroutines, the :monitoring-event:`STOP_ITERATION` event is provided. :monitoring-event:`STOP_ITERATION` can be locally disabled.
Note that the :monitoring-event:`STOP_ITERATION` event and the
:monitoring-event:`RAISE` event for a :exc:`S... | trusted_official_docs | CPython Docs | To allow tools to monitor for real exceptions without slowing down generators and coroutines, the :monitoring-event:`STOP_ITERATION` event is provided. :monitoring-event:`STOP_ITERATION` can be locally disabled.
Note that the :monitoring-event:`STOP_ITERATION` event and the
:monitoring-event:`RAISE` event for a :exc:`S... | To allow tools to monitor for real exceptions without slowing down generators and coroutines, the :monitoring-event:`STOP_ITERATION` event is provided. :monitoring-event:`STOP_ITERATION` can be locally disabled.
Note that the :monitoring-event:`STOP_ITERATION` event and the
:monitoring-event:`RAISE` event for a :exc:`S... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aec1b046-cc94-4343-91dc-2e3da5c2fde9 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,920 | supabase-export-v2 | 2f30710d712dc7cc | location by returning :data:`sys.monitoring.DISABLE` from a callback function. This does not change which events are set, or any other code locations for the same event.
:ref:`Other events <monitoring-event-global>` can be disabled on a per code
object basis by returning :data:`sys.monitoring.DISABLE` from a callback
f... | trusted_official_docs | CPython Docs | location by returning :data:`sys.monitoring.DISABLE` from a callback function. This does not change which events are set, or any other code locations for the same event.
:ref:`Other events <monitoring-event-global>` can be disabled on a per code
object basis by returning :data:`sys.monitoring.DISABLE` from a callback
f... | location by returning :data:`sys.monitoring.DISABLE` from a callback function. This does not change which events are set, or any other code locations for the same event.
:ref:`Other events <monitoring-event-global>` can be disabled on a per code
object basis by returning :data:`sys.monitoring.DISABLE` from a callback
f... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ba953cdc-3296-41f0-894f-fefaec247672 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,875 | supabase-export-v2 | ff9c4ce521adb489 | More events may be added in the future.
These events are attributes of the :mod:`!sys.monitoring.events` namespace. Each event is represented as a power-of-2 integer constant. To define a set of events, simply bitwise OR the individual events together. For example, to specify both :monitoring-event:`PY_RETURN` and :mon... | trusted_official_docs | CPython Docs | More events may be added in the future.
These events are attributes of the :mod:`!sys.monitoring.events` namespace. Each event is represented as a power-of-2 integer constant. To define a set of events, simply bitwise OR the individual events together. For example, to specify both :monitoring-event:`PY_RETURN` and :mon... | More events may be added in the future.
These events are attributes of the :mod:`!sys.monitoring.events` namespace. Each event is represented as a power-of-2 integer constant. To define a set of events, simply bitwise OR the individual events together. For example, to specify both :monitoring-event:`PY_RETURN` and :mon... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bc1fc025-3c83-4a1f-8bc9-69981d01d6ed | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,819 | supabase-export-v2 | 77f26293820281f2 | This namespace provides access to the functions and constants necessary to activate and control event monitoring.
As programs execute, events occur that might be of interest to tools that
monitor execution. The :mod:`!sys.monitoring` namespace provides means to
receive callbacks when events of interest occur. | trusted_official_docs | CPython Docs | This namespace provides access to the functions and constants necessary to activate and control event monitoring.
As programs execute, events occur that might be of interest to tools that
monitor execution. The :mod:`!sys.monitoring` namespace provides means to
receive callbacks when events of interest occur. | This namespace provides access to the functions and constants necessary to activate and control event monitoring.
As programs execute, events occur that might be of interest to tools that
monitor execution. The :mod:`!sys.monitoring` namespace provides means to
receive callbacks when events of interest occur. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c3ec1566-d21a-4881-8b67-aca53b121b52 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,919 | supabase-export-v2 | f5221e1f63f505d2 | A special value that can be returned from a callback function to disable events for the current code location.
:ref:`Local events <monitoring-event-local>` can be disabled for a specific code
location by returning :data:`sys.monitoring.DISABLE` from a callback function. This does not change which events are set, or any... | trusted_official_docs | CPython Docs | A special value that can be returned from a callback function to disable events for the current code location.
:ref:`Local events <monitoring-event-local>` can be disabled for a specific code
location by returning :data:`sys.monitoring.DISABLE` from a callback function. This does not change which events are set, or any... | A special value that can be returned from a callback function to disable events for the current code location.
:ref:`Local events <monitoring-event-local>` can be disabled for a specific code
location by returning :data:`sys.monitoring.DISABLE` from a callback function. This does not change which events are set, or any... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c44392d5-3612-47bb-8629-afdbcc94fabb | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,823 | supabase-export-v2 | bc8e69f555f658d7 | Tool identifiers ----------------
A tool identifier is an integer and the associated name. Tool identifiers are used to discourage tools from interfering with each
other and to allow multiple tools to operate at the same time. Currently tools are completely independent and cannot be used to
monitor each other. This res... | trusted_official_docs | CPython Docs | Tool identifiers ----------------
A tool identifier is an integer and the associated name. Tool identifiers are used to discourage tools from interfering with each
other and to allow multiple tools to operate at the same time. Currently tools are completely independent and cannot be used to
monitor each other. This res... | Tool identifiers ----------------
A tool identifier is an integer and the associated name. Tool identifiers are used to discourage tools from interfering with each
other and to allow multiple tools to operate at the same time. Currently tools are completely independent and cannot be used to
monitor each other. This res... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c9cdc54e-22ed-4ce4-bff0-8b8070841543 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,828 | supabase-export-v2 | ae14d5a307e85b8a | be called before *tool_id* can be used. *tool_id* must be in the range 0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use.
.. function:: clear_tool_id(tool_id: int, /) -> None | trusted_official_docs | CPython Docs | be called before *tool_id* can be used. *tool_id* must be in the range 0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use.
.. function:: clear_tool_id(tool_id: int, /) -> None | be called before *tool_id* can be used. *tool_id* must be in the range 0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use.
.. function:: clear_tool_id(tool_id: int, /) -> None | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d1783c2c-a4bd-41e3-b998-0cba79728899 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,936 | supabase-export-v2 | df7359220a187c3f | A special value that is passed to a callback function to indicate that there are no arguments to the call.
When an active event occurs, the registered callback function is called. Callback functions returning an object other than :data:`DISABLE` will have no effect. Different events will provide the callback function w... | trusted_official_docs | CPython Docs | A special value that is passed to a callback function to indicate that there are no arguments to the call.
When an active event occurs, the registered callback function is called. Callback functions returning an object other than :data:`DISABLE` will have no effect. Different events will provide the callback function w... | A special value that is passed to a callback function to indicate that there are no arguments to the call.
When an active event occurs, the registered callback function is called. Callback functions returning an object other than :data:`DISABLE` will have no effect. Different events will provide the callback function w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d2bd293d-c79d-4383-b08a-cc070ce63427 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,943 | supabase-export-v2 | a909f6a072275a4c | func(code: CodeType, instruction_offset: int, callable: object, arg0: object) -> object
*code* represents the code object where the call is being made, while
*callable* is the object that is about to be called (and thus
triggered the event). If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`. | trusted_official_docs | CPython Docs | func(code: CodeType, instruction_offset: int, callable: object, arg0: object) -> object
*code* represents the code object where the call is being made, while
*callable* is the object that is about to be called (and thus
triggered the event). If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`. | func(code: CodeType, instruction_offset: int, callable: object, arg0: object) -> object
*code* represents the code object where the call is being made, while
*callable* is the object that is about to be called (and thus
triggered the event). If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d3074186-d19e-4a9a-aa2d-dc297bfbde31 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,944 | supabase-export-v2 | b109670025f6965c | *callable* is the object that is about to be called (and thus triggered the event). If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`.
For instance methods, *callable* will be the function object as found on the
class with *arg0* set to the instance (i.e. the ``self`` argument to the
method). | trusted_official_docs | CPython Docs | *callable* is the object that is about to be called (and thus triggered the event). If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`.
For instance methods, *callable* will be the function object as found on the
class with *arg0* set to the instance (i.e. the ``self`` argument to the
method). | *callable* is the object that is about to be called (and thus triggered the event). If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`.
For instance methods, *callable* will be the function object as found on the
class with *arg0* set to the instance (i.e. the ``self`` argument to the
method). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d42116bb-368f-44ce-a01e-716ad356d86d | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,817 | supabase-export-v2 | 50a7b6e1109cbd21 | .. note::
:mod:`!sys.monitoring` is a namespace within the :mod:`sys` module,
not an independent module, and ``import sys.monitoring`` would fail
with a :exc:`ModuleNotFoundError`. Instead, simply ``import sys``
and then use ``sys.monitoring``. | trusted_official_docs | CPython Docs | .. note::
:mod:`!sys.monitoring` is a namespace within the :mod:`sys` module,
not an independent module, and ``import sys.monitoring`` would fail
with a :exc:`ModuleNotFoundError`. Instead, simply ``import sys``
and then use ``sys.monitoring``. | .. note::
:mod:`!sys.monitoring` is a namespace within the :mod:`sys` module,
not an independent module, and ``import sys.monitoring`` would fail
with a :exc:`ModuleNotFoundError`. Instead, simply ``import sys``
and then use ``sys.monitoring``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d686d7f8-a28d-4f45-b2ff-3777a763992e | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,922 | supabase-export-v2 | 11cd3ea4dafb9a7d | monitoring. For example, a program can be run under a debugger with no overhead if the debugger disables all monitoring except for a few breakpoints.
.. function:: restart_events() -> None | trusted_official_docs | CPython Docs | monitoring. For example, a program can be run under a debugger with no overhead if the debugger disables all monitoring except for a few breakpoints.
.. function:: restart_events() -> None | monitoring. For example, a program can be run under a debugger with no overhead if the debugger disables all monitoring except for a few breakpoints.
.. function:: restart_events() -> None | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e21f918d-ecd7-4669-9fa4-3fbb838b6812 | CPython Docs | file://datasets/cpython/Doc/library/sys.monitoring.rst | unknown | f0047767-ff22-4317-a3bd-754250fb54af | 9,839 | supabase-export-v2 | 8edb38991511f156 | A conditional branch goes left.
It is up to the tool to determine how to present "left" and "right" branches. There is no guarantee which branch is "left" and which is "right", except
that it will be consistent for the duration of the program. | trusted_official_docs | CPython Docs | A conditional branch goes left.
It is up to the tool to determine how to present "left" and "right" branches. There is no guarantee which branch is "left" and which is "right", except
that it will be consistent for the duration of the program. | A conditional branch goes left.
It is up to the tool to determine how to present "left" and "right" branches. There is no guarantee which branch is "left" and which is "right", except
that it will be consistent for the duration of the program. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
02d1ca6e-f230-4233-b38d-eb1d10dc6745 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,294 | supabase-export-v2 | 35f9f6a3c3ba8cd0 | :meth:`flush` temporarily disables reparse deferral with Expat (if currently enabled) and triggers a reparse. Disabling reparse deferral has security consequences; please see :meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled` for details.
:meth:`!flush`
has been backported to some prior releases of CPython ... | trusted_official_docs | CPython Docs | :meth:`flush` temporarily disables reparse deferral with Expat (if currently enabled) and triggers a reparse. Disabling reparse deferral has security consequences; please see :meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled` for details.
:meth:`!flush`
has been backported to some prior releases of CPython ... | :meth:`flush` temporarily disables reparse deferral with Expat (if currently enabled) and triggers a reparse. Disabling reparse deferral has security consequences; please see :meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled` for details.
:meth:`!flush`
has been backported to some prior releases of CPython ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
02fe71fa-295c-4bf6-a26e-2e63c37aeab5 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,237 | supabase-export-v2 | 47920456a7aca291 | .. method:: parse(source, parser=None)
Loads an external XML section into this element tree. *source* is a file
name or :term:`file object`. *parser* is an optional parser instance. If not given, the standard :class:`XMLParser` parser is used. Returns the
section root element. | trusted_official_docs | CPython Docs | .. method:: parse(source, parser=None)
Loads an external XML section into this element tree. *source* is a file
name or :term:`file object`. *parser* is an optional parser instance. If not given, the standard :class:`XMLParser` parser is used. Returns the
section root element. | .. method:: parse(source, parser=None)
Loads an external XML section into this element tree. *source* is a file
name or :term:`file object`. *parser* is an optional parser instance. If not given, the standard :class:`XMLParser` parser is used. Returns the
section root element. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
051affec-dd66-4792-a544-6e17076c4cbd | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,127 | supabase-export-v2 | 7a2725a74911e4d6 | <?xml version="1.0"?> <document xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="source.xml" parse="xml" /> </document>
By default, the **href** attribute is treated as a file name. You can use custom loaders to override this behaviour. Also note that the standard helper does not support XPointer syntax. | trusted_official_docs | CPython Docs | <?xml version="1.0"?> <document xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="source.xml" parse="xml" /> </document>
By default, the **href** attribute is treated as a file name. You can use custom loaders to override this behaviour. Also note that the standard helper does not support XPointer syntax. | <?xml version="1.0"?> <document xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="source.xml" parse="xml" /> </document>
By default, the **href** attribute is treated as a file name. You can use custom loaders to override this behaviour. Also note that the standard helper does not support XPointer syntax. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
07e75dd1-7012-442b-83d7-70333ff5ecb2 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,068 | supabase-export-v2 | f0dc9af47394bfbd | Writes an element tree or element structure to sys.stdout. This function should be used for debugging only.
The exact output format is implementation dependent. In this version, it's
written as an ordinary XML file. | trusted_official_docs | CPython Docs | Writes an element tree or element structure to sys.stdout. This function should be used for debugging only.
The exact output format is implementation dependent. In this version, it's
written as an ordinary XML file. | Writes an element tree or element structure to sys.stdout. This function should be used for debugging only.
The exact output format is implementation dependent. In this version, it's
written as an ordinary XML file. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
08ff56bc-d91a-4c65-8c21-5a81c4d78888 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,206 | supabase-export-v2 | 796a3ead605b1a40 | Removes *subelement* from the element. Unlike the find\* methods this method compares elements based on the instance identity, not on tag value or contents.
:class:`Element` objects also support the following sequence type methods
for working with subelements: :meth:`~object.__delitem__`,
:meth:`~object.__getitem__`,... | trusted_official_docs | CPython Docs | Removes *subelement* from the element. Unlike the find\* methods this method compares elements based on the instance identity, not on tag value or contents.
:class:`Element` objects also support the following sequence type methods
for working with subelements: :meth:`~object.__delitem__`,
:meth:`~object.__getitem__`,... | Removes *subelement* from the element. Unlike the find\* methods this method compares elements based on the instance identity, not on tag value or contents.
:class:`Element` objects also support the following sequence type methods
for working with subelements: :meth:`~object.__delitem__`,
:meth:`~object.__getitem__`,... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0a24d473-fb15-4afb-88a4-68c3597e8b24 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,072 | supabase-export-v2 | adcfc40aa8057c72 | .. function:: fromstring(text, parser=None)
Parses an XML section from a string constant. Same as :func:`XML`. *text*
is a string containing XML data. *parser* is an optional parser instance. If not given, the standard :class:`XMLParser` parser is used. Returns an :class:`Element` instance. | trusted_official_docs | CPython Docs | .. function:: fromstring(text, parser=None)
Parses an XML section from a string constant. Same as :func:`XML`. *text*
is a string containing XML data. *parser* is an optional parser instance. If not given, the standard :class:`XMLParser` parser is used. Returns an :class:`Element` instance. | .. function:: fromstring(text, parser=None)
Parses an XML section from a string constant. Same as :func:`XML`. *text*
is a string containing XML data. *parser* is an optional parser instance. If not given, the standard :class:`XMLParser` parser is used. Returns an :class:`Element` instance. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c8cf0b6-8ef5-44a2-8855-051204742cd7 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,149 | supabase-export-v2 | da38028936926297 | file references. *max_depth* is the maximum number of recursive inclusions. Limited to reduce the risk of malicious content explosion. Pass ``None`` to disable the limitation.
.. versionchanged:: 3.9
Added the *base_url* and *max_depth* parameters. | trusted_official_docs | CPython Docs | file references. *max_depth* is the maximum number of recursive inclusions. Limited to reduce the risk of malicious content explosion. Pass ``None`` to disable the limitation.
.. versionchanged:: 3.9
Added the *base_url* and *max_depth* parameters. | file references. *max_depth* is the maximum number of recursive inclusions. Limited to reduce the risk of malicious content explosion. Pass ``None`` to disable the limitation.
.. versionchanged:: 3.9
Added the *base_url* and *max_depth* parameters. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
102da13e-72bf-4955-a693-1ed2a1ebb6db | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,146 | supabase-export-v2 | c974db8eef37282c | .. function:: default_loader(href, parse, encoding=None)
Default loader. This default loader reads an included resource from disk. *href* is a URL. *parse* is for parse mode either "xml" or "text". *encoding* is an optional text encoding. If not given, encoding is ``utf-8``. Returns the expanded resource. If the parse ... | trusted_official_docs | CPython Docs | .. function:: default_loader(href, parse, encoding=None)
Default loader. This default loader reads an included resource from disk. *href* is a URL. *parse* is for parse mode either "xml" or "text". *encoding* is an optional text encoding. If not given, encoding is ``utf-8``. Returns the expanded resource. If the parse ... | .. function:: default_loader(href, parse, encoding=None)
Default loader. This default loader reads an included resource from disk. *href* is a URL. *parse* is for parse mode either "xml" or "text". *encoding* is an optional text encoding. If not given, encoding is ``utf-8``. Returns the expanded resource. If the parse ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
107c31e6-344e-449d-b1ff-1e950bb698ce | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 9,971 | supabase-export-v2 | f045231aabfdf007 | .. code-block:: xml
<?xml version="1.0"?>
<data>
<country name="Liechtenstein">
<rank>1</rank>
<year>2008</year>
<gdppc>141100</gdppc>
<neighbor name="Austria" direction="E"/>
<neighbor name="Switzerland" direction="W"/>
</country>
<country name="Singapore">
<rank>4</rank>
<year>2011</year>
<gdppc>59900</gd... | trusted_official_docs | CPython Docs | .. code-block:: xml
<?xml version="1.0"?>
<data>
<country name="Liechtenstein">
<rank>1</rank>
<year>2008</year>
<gdppc>141100</gdppc>
<neighbor name="Austria" direction="E"/>
<neighbor name="Switzerland" direction="W"/>
</country>
<country name="Singapore">
<rank>4</rank>
<year>2011</year>
<gdppc>59900</gd... | .. code-block:: xml
<?xml version="1.0"?>
<data>
<country name="Liechtenstein">
<rank>1</rank>
<year>2008</year>
<gdppc>141100</gdppc>
<neighbor name="Austria" direction="E"/>
<neighbor name="Switzerland" direction="W"/>
</country>
<country name="Singapore">
<rank>4</rank>
<year>2011</year>
<gdppc>59900</gd... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1166abf4-b0c7-4807-8c43-ba775bdbac58 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,117 | supabase-export-v2 | 598d86482d12bf41 | .. function:: XML(text, parser=None)
Parses an XML section from a string constant. This function can be used to
embed "XML literals" in Python code. *text* is a string containing XML
data. *parser* is an optional parser instance. If not given, the standard
:class:`XMLParser` parser is used. Returns an :class:`Elemen... | trusted_official_docs | CPython Docs | .. function:: XML(text, parser=None)
Parses an XML section from a string constant. This function can be used to
embed "XML literals" in Python code. *text* is a string containing XML
data. *parser* is an optional parser instance. If not given, the standard
:class:`XMLParser` parser is used. Returns an :class:`Elemen... | .. function:: XML(text, parser=None)
Parses an XML section from a string constant. This function can be used to
embed "XML literals" in Python code. *text* is a string containing XML
data. *parser* is an optional parser instance. If not given, the standard
:class:`XMLParser` parser is used. Returns an :class:`Elemen... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11c5f96a-ae37-43fe-bd17-5a4c425e1b9b | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,001 | supabase-export-v2 | 484835fe4e01fee8 | manipulated by directly changing its fields (such as :attr:`Element.text`), adding and modifying attributes (:meth:`Element.set` method), as well as adding new children (for example with :meth:`Element.append`).
Let's say we want to add one to each country's rank, and add an ``updated``
attribute to the rank element:: | trusted_official_docs | CPython Docs | manipulated by directly changing its fields (such as :attr:`Element.text`), adding and modifying attributes (:meth:`Element.set` method), as well as adding new children (for example with :meth:`Element.append`).
Let's say we want to add one to each country's rank, and add an ``updated``
attribute to the rank element:: | manipulated by directly changing its fields (such as :attr:`Element.text`), adding and modifying attributes (:meth:`Element.set` method), as well as adding new children (for example with :meth:`Element.append`).
Let's say we want to add one to each country's rank, and add an ``updated``
attribute to the rank element:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
126da696-fa42-441a-a96f-9f3aadda38d6 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,215 | supabase-export-v2 | 9c4cca21c72326a4 | this is difficult to achieve, a recipe like the following can be applied prior to serialisation to enforce an order independently from the Element creation::
def reorder_attributes(root):
for el in root.iter():
attrib = el.attrib
if len(attrib) > 1:
# adjust attribute order, e.g. by sorting
attribs = sorted(attrib... | trusted_official_docs | CPython Docs | this is difficult to achieve, a recipe like the following can be applied prior to serialisation to enforce an order independently from the Element creation::
def reorder_attributes(root):
for el in root.iter():
attrib = el.attrib
if len(attrib) > 1:
# adjust attribute order, e.g. by sorting
attribs = sorted(attrib... | this is difficult to achieve, a recipe like the following can be applied prior to serialisation to enforce an order independently from the Element creation::
def reorder_attributes(root):
for el in root.iter():
attrib = el.attrib
if len(attrib) > 1:
# adjust attribute order, e.g. by sorting
attribs = sorted(attrib... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
129b9005-a712-4442-bd90-7719e71a12df | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,189 | supabase-export-v2 | 0ef913ae1b773db4 | .. method:: findall(match, namespaces=None)
Finds all matching subelements, by tag name or
:ref:`path <elementtree-xpath>`. Returns a list containing all matching
elements in document order. *namespaces* is an optional mapping from
namespace prefix to full name. Pass ``''`` as prefix to move all
unprefixed tag name... | trusted_official_docs | CPython Docs | .. method:: findall(match, namespaces=None)
Finds all matching subelements, by tag name or
:ref:`path <elementtree-xpath>`. Returns a list containing all matching
elements in document order. *namespaces* is an optional mapping from
namespace prefix to full name. Pass ``''`` as prefix to move all
unprefixed tag name... | .. method:: findall(match, namespaces=None)
Finds all matching subelements, by tag name or
:ref:`path <elementtree-xpath>`. Returns a list containing all matching
elements in document order. *namespaces* is an optional mapping from
namespace prefix to full name. Pass ``''`` as prefix to move all
unprefixed tag name... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
13cf764e-f8bf-45c7-8e5c-25e506231e79 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 9,988 | supabase-export-v2 | 203e3fe73447be2b | the XML data, and is instead fed with data incrementally with :meth:`XMLPullParser.feed` calls. To get the parsed XML elements, call :meth:`XMLPullParser.read_events`. Here is an example::
>>> parser = ET.XMLPullParser(['start', 'end'])
>>> parser.feed('<mytag>sometext')
>>> list(parser.read_events())
[('start', <El... | trusted_official_docs | CPython Docs | the XML data, and is instead fed with data incrementally with :meth:`XMLPullParser.feed` calls. To get the parsed XML elements, call :meth:`XMLPullParser.read_events`. Here is an example::
>>> parser = ET.XMLPullParser(['start', 'end'])
>>> parser.feed('<mytag>sometext')
>>> list(parser.read_events())
[('start', <El... | the XML data, and is instead fed with data incrementally with :meth:`XMLPullParser.feed` calls. To get the parsed XML elements, call :meth:`XMLPullParser.read_events`. Here is an example::
>>> parser = ET.XMLPullParser(['start', 'end'])
>>> parser.feed('<mytag>sometext')
>>> list(parser.read_events())
[('start', <El... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
155ce521-ee4e-442f-becf-55e52d6b92ba | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,041 | supabase-export-v2 | 65f033e5643ecde0 | .. tabularcolumns:: |l|L|
+-----------------------+------------------------------------------------------+
| Syntax | Meaning |
+=======================+======================================================+
| ``tag`` | Selects all child elements with the given tag. |
| | For example, ``spam`` selects all child elemen... | trusted_official_docs | CPython Docs | .. tabularcolumns:: |l|L|
+-----------------------+------------------------------------------------------+
| Syntax | Meaning |
+=======================+======================================================+
| ``tag`` | Selects all child elements with the given tag. |
| | For example, ``spam`` selects all child elemen... | .. tabularcolumns:: |l|L|
+-----------------------+------------------------------------------------------+
| Syntax | Meaning |
+=======================+======================================================+
| ``tag`` | Selects all child elements with the given tag. |
| | For example, ``spam`` selects all child elemen... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15e89582-8997-47c8-af1b-139e9be2178a | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 9,991 | supabase-export-v2 | af3e1a11793b0ad1 | take a look at :func:`iterparse`. It can be useful when you're reading a large XML document and don't want to hold it wholly in memory.
Where *immediate* feedback through events is wanted, calling method
:meth:`XMLPullParser.flush` can help reduce delay;
please make sure to study the related security notes. | trusted_official_docs | CPython Docs | take a look at :func:`iterparse`. It can be useful when you're reading a large XML document and don't want to hold it wholly in memory.
Where *immediate* feedback through events is wanted, calling method
:meth:`XMLPullParser.flush` can help reduce delay;
please make sure to study the related security notes. | take a look at :func:`iterparse`. It can be useful when you're reading a large XML document and don't want to hold it wholly in memory.
Where *immediate* feedback through events is wanted, calling method
:meth:`XMLPullParser.flush` can help reduce delay;
please make sure to study the related security notes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
16aa2f21-cd2b-42a9-9f0d-7ac233c567ac | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,111 | supabase-export-v2 | 27adde346e944eeb | .. function:: tostringlist(element, encoding="us-ascii", method="xml", *, \ xml_declaration=None, default_namespace=None, \ short_empty_elements=True)
Generates a string representation of an XML element, including all
subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is
the output encoding (defa... | trusted_official_docs | CPython Docs | .. function:: tostringlist(element, encoding="us-ascii", method="xml", *, \ xml_declaration=None, default_namespace=None, \ short_empty_elements=True)
Generates a string representation of an XML element, including all
subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is
the output encoding (defa... | .. function:: tostringlist(element, encoding="us-ascii", method="xml", *, \ xml_declaration=None, default_namespace=None, \ short_empty_elements=True)
Generates a string representation of an XML element, including all
subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is
the output encoding (defa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
191396c8-3143-4c21-b3ba-5bf4f13963cc | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,107 | supabase-export-v2 | b4f2dc3c89e21d68 | or ``"text"`` (default is ``"xml"``). *xml_declaration*, *default_namespace* and *short_empty_elements* has the same meaning as in :meth:`ElementTree.write`. Returns an (optionally) encoded string containing the XML data.
.. versionchanged:: 3.4
Added the *short_empty_elements* parameter. | trusted_official_docs | CPython Docs | or ``"text"`` (default is ``"xml"``). *xml_declaration*, *default_namespace* and *short_empty_elements* has the same meaning as in :meth:`ElementTree.write`. Returns an (optionally) encoded string containing the XML data.
.. versionchanged:: 3.4
Added the *short_empty_elements* parameter. | or ``"text"`` (default is ``"xml"``). *xml_declaration*, *default_namespace* and *short_empty_elements* has the same meaning as in :meth:`ElementTree.write`. Returns an (optionally) encoded string containing the XML data.
.. versionchanged:: 3.4
Added the *short_empty_elements* parameter. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1d6f8d8a-7969-47b8-8b7b-e6587cc47d84 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,241 | supabase-export-v2 | 692a01ce30a5d145 | of *file* if it's an open :term:`file object`; make sure you do not try to write a string to a binary stream and vice versa.
.. versionchanged:: 3.4
Added the *short_empty_elements* parameter. | trusted_official_docs | CPython Docs | of *file* if it's an open :term:`file object`; make sure you do not try to write a string to a binary stream and vice versa.
.. versionchanged:: 3.4
Added the *short_empty_elements* parameter. | of *file* if it's an open :term:`file object`; make sure you do not try to write a string to a binary stream and vice versa.
.. versionchanged:: 3.4
Added the *short_empty_elements* parameter. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1edc9b92-d012-414e-bbd7-c1ee39460757 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,163 | supabase-export-v2 | 0fd4411ead9d4652 | <a><b>1<c>2<d/>3</c></b>4</a>
the *a* element has ``None`` for both *text* and *tail* attributes,
the *b* element has *text* ``"1"`` and *tail* ``"4"``,
the *c* element has *text* ``"2"`` and *tail* ``None``,
and the *d* element has *text* ``None`` and *tail* ``"3"``. | trusted_official_docs | CPython Docs | <a><b>1<c>2<d/>3</c></b>4</a>
the *a* element has ``None`` for both *text* and *tail* attributes,
the *b* element has *text* ``"1"`` and *tail* ``"4"``,
the *c* element has *text* ``"2"`` and *tail* ``None``,
and the *d* element has *text* ``None`` and *tail* ``"3"``. | <a><b>1<c>2<d/>3</c></b>4</a>
the *a* element has ``None`` for both *text* and *tail* attributes,
the *b* element has *text* ``"1"`` and *tail* ``"4"``,
the *c* element has *text* ``"2"`` and *tail* ``None``,
and the *d* element has *text* ``None`` and *tail* ``"3"``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1f5ed8e8-2b7a-4ac7-a10b-25a1138f4bfb | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,046 | supabase-export-v2 | c143f3ba38a652eb | ``[.='text']`` | Selects all elements whose complete text content, | | | including descendants, equals the given ``text``. | | | | | | ..
versionadded:: 3.7 |
+-----------------------+------------------------------------------------------+
| ``[.!='text']`` | Selects all elements whose complete text content, |
| | incl... | trusted_official_docs | CPython Docs | ``[.='text']`` | Selects all elements whose complete text content, | | | including descendants, equals the given ``text``. | | | | | | ..
versionadded:: 3.7 |
+-----------------------+------------------------------------------------------+
| ``[.!='text']`` | Selects all elements whose complete text content, |
| | incl... | ``[.='text']`` | Selects all elements whose complete text content, | | | including descendants, equals the given ``text``. | | | | | | ..
versionadded:: 3.7 |
+-----------------------+------------------------------------------------------+
| ``[.!='text']`` | Selects all elements whose complete text content, |
| | incl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
225b7e50-e831-4891-8019-285e186c2b02 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,220 | supabase-export-v2 | 70d888cf84cc783c | ElementTree wrapper class. This class represents an entire element hierarchy, and adds some extra support for serialization to and from standard XML.
*element* is the root element. The tree is initialized with the contents
of the XML *file* if given. | trusted_official_docs | CPython Docs | ElementTree wrapper class. This class represents an entire element hierarchy, and adds some extra support for serialization to and from standard XML.
*element* is the root element. The tree is initialized with the contents
of the XML *file* if given. | ElementTree wrapper class. This class represents an entire element hierarchy, and adds some extra support for serialization to and from standard XML.
*element* is the root element. The tree is initialized with the contents
of the XML *file* if given. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
233148e7-48a3-4b26-8b18-b477a8f8173f | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,214 | supabase-export-v2 | 35c838bb6a9a5935 | input. In cases where deterministic XML output is required, e.g. for cryptographic signing or test data sets, canonical serialisation is available with the :func:`canonicalize` function.
In cases where canonical output is not applicable but a specific attribute
order is still desirable on output, code should aim for c... | trusted_official_docs | CPython Docs | input. In cases where deterministic XML output is required, e.g. for cryptographic signing or test data sets, canonical serialisation is available with the :func:`canonicalize` function.
In cases where canonical output is not applicable but a specific attribute
order is still desirable on output, code should aim for c... | input. In cases where deterministic XML output is required, e.g. for cryptographic signing or test data sets, canonical serialisation is available with the :func:`canonicalize` function.
In cases where canonical output is not applicable but a specific attribute
order is still desirable on output, code should aim for c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
23cd5069-700e-4639-bf6e-63456264b0e4 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,083 | supabase-export-v2 | fcd316c1e4051429 | :term:`iterator` providing ``(event, elem)`` pairs; it has a ``root`` attribute that references the root element of the resulting XML tree once *source* is fully read.
The iterator has the :meth:`!close` method that closes the internal
file object if *source* is a filename. | trusted_official_docs | CPython Docs | :term:`iterator` providing ``(event, elem)`` pairs; it has a ``root`` attribute that references the root element of the resulting XML tree once *source* is fully read.
The iterator has the :meth:`!close` method that closes the internal
file object if *source* is a filename. | :term:`iterator` providing ``(event, elem)`` pairs; it has a ``root`` attribute that references the root element of the resulting XML tree once *source* is fully read.
The iterator has the :meth:`!close` method that closes the internal
file object if *source* is a filename. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
23fa27c0-7d92-4160-8cf2-64449872fcd8 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,287 | supabase-export-v2 | 44e5aba181e3c48b | object. If *target* is omitted, the standard :class:`TreeBuilder` is used. If *encoding* [1]_ is given, the value overrides the encoding specified in the XML file.
.. versionchanged:: 3.8
Parameters are now :ref:`keyword-only <keyword-only_parameter>`. The *html* argument is no longer supported. | trusted_official_docs | CPython Docs | object. If *target* is omitted, the standard :class:`TreeBuilder` is used. If *encoding* [1]_ is given, the value overrides the encoding specified in the XML file.
.. versionchanged:: 3.8
Parameters are now :ref:`keyword-only <keyword-only_parameter>`. The *html* argument is no longer supported. | object. If *target* is omitted, the standard :class:`TreeBuilder` is used. If *encoding* [1]_ is given, the value overrides the encoding specified in the XML file.
.. versionchanged:: 3.8
Parameters are now :ref:`keyword-only <keyword-only_parameter>`. The *html* argument is no longer supported. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
262fe145-87bc-45b5-99a3-9494e38d7bcd | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,004 | supabase-export-v2 | a8a114555c7a56ad | .. code-block:: xml
<?xml version="1.0"?>
<data>
<country name="Liechtenstein">
<rank updated="yes">2</rank>
<year>2008</year>
<gdppc>141100</gdppc>
<neighbor name="Austria" direction="E"/>
<neighbor name="Switzerland" direction="W"/>
</country>
<country name="Singapore">
<rank updated="yes">5</rank>
<year>2... | trusted_official_docs | CPython Docs | .. code-block:: xml
<?xml version="1.0"?>
<data>
<country name="Liechtenstein">
<rank updated="yes">2</rank>
<year>2008</year>
<gdppc>141100</gdppc>
<neighbor name="Austria" direction="E"/>
<neighbor name="Switzerland" direction="W"/>
</country>
<country name="Singapore">
<rank updated="yes">5</rank>
<year>2... | .. code-block:: xml
<?xml version="1.0"?>
<data>
<country name="Liechtenstein">
<rank updated="yes">2</rank>
<year>2008</year>
<gdppc>141100</gdppc>
<neighbor name="Austria" direction="E"/>
<neighbor name="Switzerland" direction="W"/>
</country>
<country name="Singapore">
<rank updated="yes">5</rank>
<year>2... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
265f565c-6cd1-41b1-860e-ebd249222d61 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,045 | supabase-export-v2 | afe9fef50ebec3f7 | attribute | | | does not have the given value. The value cannot | | | contain quotes. | | | | | | ..
versionadded:: 3.10 |
+-----------------------+------------------------------------------------------+
| ``[tag]`` | Selects all elements that have a child named |
| | ``tag``. Only immediate children are supported. |
+... | trusted_official_docs | CPython Docs | attribute | | | does not have the given value. The value cannot | | | contain quotes. | | | | | | ..
versionadded:: 3.10 |
+-----------------------+------------------------------------------------------+
| ``[tag]`` | Selects all elements that have a child named |
| | ``tag``. Only immediate children are supported. |
+... | attribute | | | does not have the given value. The value cannot | | | contain quotes. | | | | | | ..
versionadded:: 3.10 |
+-----------------------+------------------------------------------------------+
| ``[tag]`` | Selects all elements that have a child named |
| | ``tag``. Only immediate children are supported. |
+... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2bb8da42-6a6a-4e89-bab5-47a9a050e4da | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,093 | supabase-export-v2 | b47c6b458f88bda0 | .. function:: parse(source, parser=None)
Parses an XML section into an element tree. *source* is a filename or file
object containing XML data. *parser* is an optional parser instance. If
not given, the standard :class:`XMLParser` parser is used. Returns an
:class:`ElementTree` instance. | trusted_official_docs | CPython Docs | .. function:: parse(source, parser=None)
Parses an XML section into an element tree. *source* is a filename or file
object containing XML data. *parser* is an optional parser instance. If
not given, the standard :class:`XMLParser` parser is used. Returns an
:class:`ElementTree` instance. | .. function:: parse(source, parser=None)
Parses an XML section into an element tree. *source* is a filename or file
object containing XML data. *parser* is an optional parser instance. If
not given, the standard :class:`XMLParser` parser is used. Returns an
:class:`ElementTree` instance. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e0702da-c3dc-4a9e-9d92-1a8f84eba7a0 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,128 | supabase-export-v2 | df9b763a62330f81 | treated as a file name. You can use custom loaders to override this behaviour. Also note that the standard helper does not support XPointer syntax.
To process this file, load it as usual, and pass the root element to the :mod:`!xml.etree.ElementTree` module: | trusted_official_docs | CPython Docs | treated as a file name. You can use custom loaders to override this behaviour. Also note that the standard helper does not support XPointer syntax.
To process this file, load it as usual, and pass the root element to the :mod:`!xml.etree.ElementTree` module: | treated as a file name. You can use custom loaders to override this behaviour. Also note that the standard helper does not support XPointer syntax.
To process this file, load it as usual, and pass the root element to the :mod:`!xml.etree.ElementTree` module: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
32b78fdf-5774-42a9-a0cc-a400bcaac657 | CPython Docs | file://datasets/cpython/Doc/library/xml.etree.elementtree.rst | unknown | d81dc7a8-b7b0-48c6-8470-b95d3f6d7eca | 10,314 | supabase-export-v2 | eaf8485952bf14da | .. note::
:class:`XMLPullParser` only guarantees that it has seen the ">"
character of a starting tag when it emits a "start" event, so the
attributes are defined, but the contents of the text and tail attributes
are undefined at that point. The same applies to the element children;
they may or may not be present. | trusted_official_docs | CPython Docs | .. note::
:class:`XMLPullParser` only guarantees that it has seen the ">"
character of a starting tag when it emits a "start" event, so the
attributes are defined, but the contents of the text and tail attributes
are undefined at that point. The same applies to the element children;
they may or may not be present. | .. note::
:class:`XMLPullParser` only guarantees that it has seen the ">"
character of a starting tag when it emits a "start" event, so the
attributes are defined, but the contents of the text and tail attributes
are undefined at that point. The same applies to the element children;
they may or may not be present. | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.