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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c34167f9-48cd-42a9-b507-efcfa560e073 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,496 | supabase-export-v2 | e050de0f1657de2e | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.rjust(width, fillbyte=b' ', /)
bytearray.rjust(width, fillbyte=b' ', /) | trusted_official_docs | CPython Docs | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.rjust(width, fillbyte=b' ', /)
bytearray.rjust(width, fillbyte=b' ', /) | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.rjust(width, fillbyte=b' ', /)
bytearray.rjust(width, fillbyte=b' ', /) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c38f5e81-d8a1-407b-b7b6-2a22e8902395 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,384 | supabase-export-v2 | ab193c274580ce34 | *n* bytes from the bytearray and return them as an immutable :class:`bytes`. By default (if *n* is ``None``), return all bytes and clear the bytearray.
If *n* is negative, index from the end and take the first :func:`len`
plus *n* bytes. If *n* is out of bounds, raise :exc:`IndexError`. | trusted_official_docs | CPython Docs | *n* bytes from the bytearray and return them as an immutable :class:`bytes`. By default (if *n* is ``None``), return all bytes and clear the bytearray.
If *n* is negative, index from the end and take the first :func:`len`
plus *n* bytes. If *n* is out of bounds, raise :exc:`IndexError`. | *n* bytes from the bytearray and return them as an immutable :class:`bytes`. By default (if *n* is ``None``), return all bytes and clear the bytearray.
If *n* is negative, index from the end and take the first :func:`len`
plus *n* bytes. If *n* is out of bounds, raise :exc:`IndexError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c4317652-f2e4-48a9-ac02-9e08e45fd266 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,350 | supabase-export-v2 | 98fc06570c55d06c | .. versionchanged:: 3.8 :meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters to insert separators between bytes in the hex output.
Since bytes objects are sequences of integers (akin to a tuple), for a bytes
object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes
object of leng... | trusted_official_docs | CPython Docs | .. versionchanged:: 3.8 :meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters to insert separators between bytes in the hex output.
Since bytes objects are sequences of integers (akin to a tuple), for a bytes
object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes
object of leng... | .. versionchanged:: 3.8 :meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters to insert separators between bytes in the hex output.
Since bytes objects are sequences of integers (akin to a tuple), for a bytes
object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes
object of leng... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c48b7057-0a7d-4f15-92fd-c72372ed4ba3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,639 | supabase-export-v2 | 95e0626cb82c2e46 | | | | precision, decimal format otherwise. | | +------------+-----------------------------------------------------+-------+ | ``'c'`` | Single byte (accepts integer or single | | | | byte objects).
| |
+------------+-----------------------------------------------------+-------+
| ``'b'`` | Bytes (any object that follow... | trusted_official_docs | CPython Docs | | | | precision, decimal format otherwise. | | +------------+-----------------------------------------------------+-------+ | ``'c'`` | Single byte (accepts integer or single | | | | byte objects).
| |
+------------+-----------------------------------------------------+-------+
| ``'b'`` | Bytes (any object that follow... | | | | precision, decimal format otherwise. | | +------------+-----------------------------------------------------+-------+ | ``'c'`` | Single byte (accepts integer or single | | | | byte objects).
| |
+------------+-----------------------------------------------------+-------+
| ``'b'`` | Bytes (any object that follow... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c534dace-bfd1-4b28-ba5b-4fa8ffb25b01 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,437 | supabase-export-v2 | 0f49ff52c10a680a | *sub* is contained in the slice ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` if *sub* is not found.
The subsequence to search for may be any :term:`bytes-like object` or an
integer in the range 0 to 255. | trusted_official_docs | CPython Docs | *sub* is contained in the slice ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` if *sub* is not found.
The subsequence to search for may be any :term:`bytes-like object` or an
integer in the range 0 to 255. | *sub* is contained in the slice ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` if *sub* is not found.
The subsequence to search for may be any :term:`bytes-like object` or an
integer in the range 0 to 255. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c66bca90-8d3b-4fb4-a918-25deda584e53 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,346 | supabase-export-v2 | 6010a7a37700573f | >>> b'\xf0\xf1\xf2'.hex() 'f0f1f2'
If you want to make the hex string easier to read, you can specify a
single character separator *sep* parameter to include in the output. By default, this separator will be included between each byte. A second optional *bytes_per_sep* parameter controls the spacing. Positive values c... | trusted_official_docs | CPython Docs | >>> b'\xf0\xf1\xf2'.hex() 'f0f1f2'
If you want to make the hex string easier to read, you can specify a
single character separator *sep* parameter to include in the output. By default, this separator will be included between each byte. A second optional *bytes_per_sep* parameter controls the spacing. Positive values c... | >>> b'\xf0\xf1\xf2'.hex() 'f0f1f2'
If you want to make the hex string easier to read, you can specify a
single character separator *sep* parameter to include in the output. By default, this separator will be included between each byte. A second optional *bytes_per_sep* parameter controls the spacing. Positive values c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c802101d-c4b0-41d8-ba4d-d578d3bf8078 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,977 | supabase-export-v2 | d3ed4542f366841e | its methods, see :ref:`textseq` and the :ref:`string-methods` section below. To output formatted strings, see the :ref:`f-strings` and :ref:`formatstrings` sections. In addition, see the :ref:`stringservices` section.
.. index::
pair: string; methods | trusted_official_docs | CPython Docs | its methods, see :ref:`textseq` and the :ref:`string-methods` section below. To output formatted strings, see the :ref:`f-strings` and :ref:`formatstrings` sections. In addition, see the :ref:`stringservices` section.
.. index::
pair: string; methods | its methods, see :ref:`textseq` and the :ref:`string-methods` section below. To output formatted strings, see the :ref:`f-strings` and :ref:`formatstrings` sections. In addition, see the :ref:`stringservices` section.
.. index::
pair: string; methods | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c80ac856-0586-4a89-81d9-ffe9afa92bd9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,663 | supabase-export-v2 | 724894beef9b3bb9 | The :class:`~memoryview.itemsize` attribute will give you the number of bytes in a single element.
A :class:`memoryview` supports slicing and indexing to expose its data. One-dimensional slicing will result in a subview:: | trusted_official_docs | CPython Docs | The :class:`~memoryview.itemsize` attribute will give you the number of bytes in a single element.
A :class:`memoryview` supports slicing and indexing to expose its data. One-dimensional slicing will result in a subview:: | The :class:`~memoryview.itemsize` attribute will give you the number of bytes in a single element.
A :class:`memoryview` supports slicing and indexing to expose its data. One-dimensional slicing will result in a subview:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c817f6c0-c658-4dd0-9e57-eae8678540d6 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,943 | supabase-export-v2 | 1600ce86305a8ad0 | The value of the *step* parameter (or ``1`` if the parameter was not supplied)
The advantage of the :class:`range` type over a regular :class:`list` or
:class:`tuple` is that a :class:`range` object will always take the same
(small) amount of memory, no matter the size of the range it represents (as it
only stores the ... | trusted_official_docs | CPython Docs | The value of the *step* parameter (or ``1`` if the parameter was not supplied)
The advantage of the :class:`range` type over a regular :class:`list` or
:class:`tuple` is that a :class:`range` object will always take the same
(small) amount of memory, no matter the size of the range it represents (as it
only stores the ... | The value of the *step* parameter (or ``1`` if the parameter was not supplied)
The advantage of the :class:`range` type over a regular :class:`list` or
:class:`tuple` is that a :class:`range` object will always take the same
(small) amount of memory, no matter the size of the range it represents (as it
only stores the ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c86cba79-4253-4449-aaba-05a167c391eb | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,779 | supabase-export-v2 | 1e5d0076fa7569ab | - The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are used as hash values for positive infinity or negative infinity (respectively).
- For a :class:`complex` number ``z``, the hash values of the real
and imaginary parts are combined by computing ``hash(z.real) +
sys.hash_info.imag * hash(z.imag... | trusted_official_docs | CPython Docs | - The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are used as hash values for positive infinity or negative infinity (respectively).
- For a :class:`complex` number ``z``, the hash values of the real
and imaginary parts are combined by computing ``hash(z.real) +
sys.hash_info.imag * hash(z.imag... | - The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are used as hash values for positive infinity or negative infinity (respectively).
- For a :class:`complex` number ``z``, the hash values of the real
and imaginary parts are combined by computing ``hash(z.real) +
sys.hash_info.imag * hash(z.imag... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c8da44c1-5d84-4af0-ab3f-6f99aeacd841 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,673 | supabase-export-v2 | 73a009cf6f41988d | (3) .. index:: pair: module; math single: floor() (in module math) single: ceil() (in module math) single: trunc() (in module math) pair: numeric; conversions
Conversion from :class:`float` to :class:`int` truncates, discarding the
fractional part. See functions :func:`math.floor` and :func:`math.ceil` for
alternativ... | trusted_official_docs | CPython Docs | (3) .. index:: pair: module; math single: floor() (in module math) single: ceil() (in module math) single: trunc() (in module math) pair: numeric; conversions
Conversion from :class:`float` to :class:`int` truncates, discarding the
fractional part. See functions :func:`math.floor` and :func:`math.ceil` for
alternativ... | (3) .. index:: pair: module; math single: floor() (in module math) single: ceil() (in module math) single: trunc() (in module math) pair: numeric; conversions
Conversion from :class:`float` to :class:`int` truncates, discarding the
fractional part. See functions :func:`math.floor` and :func:`math.ceil` for
alternativ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ca014a00-3cfd-4689-b870-810f59f3db7f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,838 | supabase-export-v2 | 9879cc38e9b908d6 | Further explanation is available in the FAQ entry :ref:`faq-multidimensional-list`.
(3)
If *i* or *j* is negative, the index is relative to the end of sequence *s*:
``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is
still ``0``. | trusted_official_docs | CPython Docs | Further explanation is available in the FAQ entry :ref:`faq-multidimensional-list`.
(3)
If *i* or *j* is negative, the index is relative to the end of sequence *s*:
``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is
still ``0``. | Further explanation is available in the FAQ entry :ref:`faq-multidimensional-list`.
(3)
If *i* or *j* is negative, the index is relative to the end of sequence *s*:
``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is
still ``0``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ca45804f-3f9b-4b15-bc34-13035d44deb5 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,305 | supabase-export-v2 | a40fb45eeb9fff76 | | | +------------+-----------------------------------------------------+-------+ | ``'%'`` | No argument is converted, results in a ``'%'`` | | | | character in the result. | | +------------+-----------------------------------------------------+-------+
For floating-point formats, the result should be correctly rounded... | trusted_official_docs | CPython Docs | | | +------------+-----------------------------------------------------+-------+ | ``'%'`` | No argument is converted, results in a ``'%'`` | | | | character in the result. | | +------------+-----------------------------------------------------+-------+
For floating-point formats, the result should be correctly rounded... | | | +------------+-----------------------------------------------------+-------+ | ``'%'`` | No argument is converted, results in a ``'%'`` | | | | character in the result. | | +------------+-----------------------------------------------------+-------+
For floating-point formats, the result should be correctly rounded... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ca6f5cca-ef85-499d-8191-794596e68f48 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,715 | supabase-export-v2 | d9ab51eb1fbd683c | to represent the integer. If *signed* is ``False`` and a negative integer is given, an :exc:`OverflowError` is raised. The default value for *signed* is ``False``.
The default values can be used to conveniently turn an integer into a
single byte object:: | trusted_official_docs | CPython Docs | to represent the integer. If *signed* is ``False`` and a negative integer is given, an :exc:`OverflowError` is raised. The default value for *signed* is ``False``.
The default values can be used to conveniently turn an integer into a
single byte object:: | to represent the integer. If *signed* is ``False`` and a negative integer is given, an :exc:`OverflowError` is raised. The default value for *signed* is ``False``.
The default values can be used to conveniently turn an integer into a
single byte object:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ca931f0c-752a-4fcc-b4c9-0a5a5bd220c8 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,632 | supabase-export-v2 | b1e8fb33c6fdb513 | | *y* | | +-------------+---------------------------------+-------+ | ``not x`` | if *x* is false, then ``True``, | \(3) | | | else ``False`` | | +-------------+---------------------------------+-------+
.. index::
pair: operator; and
pair: operator; or
pair: operator; not | trusted_official_docs | CPython Docs | | *y* | | +-------------+---------------------------------+-------+ | ``not x`` | if *x* is false, then ``True``, | \(3) | | | else ``False`` | | +-------------+---------------------------------+-------+
.. index::
pair: operator; and
pair: operator; or
pair: operator; not | | *y* | | +-------------+---------------------------------+-------+ | ``not x`` | if *x* is false, then ``True``, | \(3) | | | else ``False`` | | +-------------+---------------------------------+-------+
.. index::
pair: operator; and
pair: operator; or
pair: operator; not | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cab104c5-7c9c-413f-9adc-66dde7a6c8bc | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,949 | supabase-export-v2 | e73708e0dce9a06e | versionchanged:: 3.3 Define '==' and '!=' to compare range objects based on the sequence of values they define (instead of comparing based on object identity).
Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step`
attributes. | trusted_official_docs | CPython Docs | versionchanged:: 3.3 Define '==' and '!=' to compare range objects based on the sequence of values they define (instead of comparing based on object identity).
Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step`
attributes. | versionchanged:: 3.3 Define '==' and '!=' to compare range objects based on the sequence of values they define (instead of comparing based on object identity).
Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step`
attributes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cb8141be-8ffd-40b0-a059-470a180ac0a2 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,433 | supabase-export-v2 | 912a2f86413fa174 | .. method:: bytes.endswith(suffix[, start[, end]]) bytearray.endswith(suffix[, start[, end]])
Return ``True`` if the binary data ends with the specified *suffix*,
otherwise return ``False``. *suffix* can also be a tuple of suffixes to
look for. With optional *start*, test beginning at that position. With
optional *e... | trusted_official_docs | CPython Docs | .. method:: bytes.endswith(suffix[, start[, end]]) bytearray.endswith(suffix[, start[, end]])
Return ``True`` if the binary data ends with the specified *suffix*,
otherwise return ``False``. *suffix* can also be a tuple of suffixes to
look for. With optional *start*, test beginning at that position. With
optional *e... | .. method:: bytes.endswith(suffix[, start[, end]]) bytearray.endswith(suffix[, start[, end]])
Return ``True`` if the binary data ends with the specified *suffix*,
otherwise return ``False``. *suffix* can also be a tuple of suffixes to
look for. With optional *start*, test beginning at that position. With
optional *e... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cb8e3f1d-a53a-4678-a59e-54b2e7fdbd88 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,323 | supabase-export-v2 | eca9c2917b6e87ff | They are supported by :class:`memoryview` which uses the :ref:`buffer protocol <bufferobjects>` to access the memory of other binary objects without needing to make a copy.
The :mod:`array` module supports efficient storage of basic data types like
32-bit integers and IEEE754 double-precision floating values. | trusted_official_docs | CPython Docs | They are supported by :class:`memoryview` which uses the :ref:`buffer protocol <bufferobjects>` to access the memory of other binary objects without needing to make a copy.
The :mod:`array` module supports efficient storage of basic data types like
32-bit integers and IEEE754 double-precision floating values. | They are supported by :class:`memoryview` which uses the :ref:`buffer protocol <bufferobjects>` to access the memory of other binary objects without needing to make a copy.
The :mod:`array` module supports efficient storage of basic data types like
32-bit integers and IEEE754 double-precision floating values. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cbe9a4a4-d7e9-4a5f-be85-db04e3782241 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,009 | supabase-export-v2 | a1acd9210ef91a74 | .. method:: str.endswith(suffix[, start[, end]])
Return ``True`` if the string ends with the specified *suffix*, otherwise return
``False``. *suffix* can also be a tuple of suffixes to look for. With optional
*start*, test beginning at that position. With optional *end*, stop comparing
at that position. Using *start... | trusted_official_docs | CPython Docs | .. method:: str.endswith(suffix[, start[, end]])
Return ``True`` if the string ends with the specified *suffix*, otherwise return
``False``. *suffix* can also be a tuple of suffixes to look for. With optional
*start*, test beginning at that position. With optional *end*, stop comparing
at that position. Using *start... | .. method:: str.endswith(suffix[, start[, end]])
Return ``True`` if the string ends with the specified *suffix*, otherwise return
``False``. *suffix* can also be a tuple of suffixes to look for. With optional
*start*, test beginning at that position. With optional *end*, stop comparing
at that position. Using *start... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cbfde2a7-34ac-49e9-9de4-0b3997b4cee0 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,815 | supabase-export-v2 | 0c30ac2416647668 | Generator Types ---------------
Python's :term:`generator`\s provide a convenient way to implement the iterator
protocol. If a container object's :meth:`~object.__iter__` method is implemented as a
generator, it will automatically return an iterator object (technically, a
generator object) supplying the :meth:`~iterato... | trusted_official_docs | CPython Docs | Generator Types ---------------
Python's :term:`generator`\s provide a convenient way to implement the iterator
protocol. If a container object's :meth:`~object.__iter__` method is implemented as a
generator, it will automatically return an iterator object (technically, a
generator object) supplying the :meth:`~iterato... | Generator Types ---------------
Python's :term:`generator`\s provide a convenient way to implement the iterator
protocol. If a container object's :meth:`~object.__iter__` method is implemented as a
generator, it will automatically return an iterator object (technically, a
generator object) supplying the :meth:`~iterato... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ccf4bc09-aa9c-41c6-861e-6d224f1e5b03 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,664 | supabase-export-v2 | a716931e80f7a8e6 | A comparison between numbers of different types behaves as though the exact values of those numbers were being compared. [2]_
All numeric types (except complex) support the following operations (for priorities of
the operations, see :ref:`operator-summary`): | trusted_official_docs | CPython Docs | A comparison between numbers of different types behaves as though the exact values of those numbers were being compared. [2]_
All numeric types (except complex) support the following operations (for priorities of
the operations, see :ref:`operator-summary`): | A comparison between numbers of different types behaves as though the exact values of those numbers were being compared. [2]_
All numeric types (except complex) support the following operations (for priorities of
the operations, see :ref:`operator-summary`): | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cd7a42fd-2117-43f8-bbf5-584268b66cc7 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,808 | supabase-export-v2 | 4fe73b904c8e679e | .. method:: iterator.__iter__()
Return the :term:`iterator` object itself. This is required to allow both
containers and iterators to be used with the :keyword:`for` and
:keyword:`in` statements. This method corresponds to the
:c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python
objects in the Py... | trusted_official_docs | CPython Docs | .. method:: iterator.__iter__()
Return the :term:`iterator` object itself. This is required to allow both
containers and iterators to be used with the :keyword:`for` and
:keyword:`in` statements. This method corresponds to the
:c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python
objects in the Py... | .. method:: iterator.__iter__()
Return the :term:`iterator` object itself. This is required to allow both
containers and iterators to be used with the :keyword:`for` and
:keyword:`in` statements. This method corresponds to the
:c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python
objects in the Py... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cd7b9534-9317-4beb-be67-58097d6679c5 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,417 | supabase-export-v2 | 01fc13d699f736c1 | .. method:: bytes.removesuffix(suffix, /) bytearray.removesuffix(suffix, /)
If the binary data ends with the *suffix* string and that *suffix* is
not empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of
the original binary data:: | trusted_official_docs | CPython Docs | .. method:: bytes.removesuffix(suffix, /) bytearray.removesuffix(suffix, /)
If the binary data ends with the *suffix* string and that *suffix* is
not empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of
the original binary data:: | .. method:: bytes.removesuffix(suffix, /) bytearray.removesuffix(suffix, /)
If the binary data ends with the *suffix* string and that *suffix* is
not empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of
the original binary data:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ce0970fb-5c6e-40e0-b5ec-b951ed3a04e3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,426 | supabase-export-v2 | 2bd0279feefc1013 | *encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for possible values.
*errors* controls how decoding errors are handled. If ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``,
and any other name registered via :func:`codecs.regi... | trusted_official_docs | CPython Docs | *encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for possible values.
*errors* controls how decoding errors are handled. If ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``,
and any other name registered via :func:`codecs.regi... | *encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for possible values.
*errors* controls how decoding errors are handled. If ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``,
and any other name registered via :func:`codecs.regi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cfe4f879-21c3-4366-bfc5-a80ea63af3ea | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,744 | supabase-export-v2 | f4f7bd078dc5d12a | the same value (within Python's floating-point precision) is returned. If the argument is outside the range of a Python float, an :exc:`OverflowError` will be raised.
For a general Python object ``x``, ``float.from_number(x)`` delegates to
``x.__float__()``. If :meth:`~object.__float__` is not defined then it falls ba... | trusted_official_docs | CPython Docs | the same value (within Python's floating-point precision) is returned. If the argument is outside the range of a Python float, an :exc:`OverflowError` will be raised.
For a general Python object ``x``, ``float.from_number(x)`` delegates to
``x.__float__()``. If :meth:`~object.__float__` is not defined then it falls ba... | the same value (within Python's floating-point precision) is returned. If the argument is outside the range of a Python float, an :exc:`OverflowError` will be raised.
For a general Python object ``x``, ``float.from_number(x)`` delegates to
``x.__float__()``. If :meth:`~object.__float__` is not defined then it falls ba... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d0b9ad05-984d-4b53-b03e-432231b2ef3a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,638 | supabase-export-v2 | d0182da4246f64c7 | Comparisons ===========
.. index::
pair: chaining; comparisons
pair: operator; comparison
pair: operator; ==
pair: operator; < (less)
pair: operator; <=
pair: operator; > (greater)
pair: operator; >=
pair: operator; !=
pair: operator; is
pair: operator; is not | trusted_official_docs | CPython Docs | Comparisons ===========
.. index::
pair: chaining; comparisons
pair: operator; comparison
pair: operator; ==
pair: operator; < (less)
pair: operator; <=
pair: operator; > (greater)
pair: operator; >=
pair: operator; !=
pair: operator; is
pair: operator; is not | Comparisons ===========
.. index::
pair: chaining; comparisons
pair: operator; comparison
pair: operator; ==
pair: operator; < (less)
pair: operator; <=
pair: operator; > (greater)
pair: operator; >=
pair: operator; !=
pair: operator; is
pair: operator; is not | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d2577190-4527-47a7-98a6-7841e0163c52 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,401 | supabase-export-v2 | a0a9d3c0e8356f80 | a = b"abc" b = a.replace(b"a", b"f")
Some bytes and bytearray operations assume the use of ASCII compatible
binary formats, and hence should be avoided when working with arbitrary
binary data. These restrictions are covered below. | trusted_official_docs | CPython Docs | a = b"abc" b = a.replace(b"a", b"f")
Some bytes and bytearray operations assume the use of ASCII compatible
binary formats, and hence should be avoided when working with arbitrary
binary data. These restrictions are covered below. | a = b"abc" b = a.replace(b"a", b"f")
Some bytes and bytearray operations assume the use of ASCII compatible
binary formats, and hence should be avoided when working with arbitrary
binary data. These restrictions are covered below. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d3b59660-1532-4cbd-8a34-0762d2c43d27 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,985 | supabase-export-v2 | b093cfb6123228f0 | Return a copy of the string with its first character capitalized and the rest lowercased.
.. versionchanged:: 3.8
The first character is now put into titlecase rather than uppercase. This means that characters like digraphs will only have their first
letter capitalized, instead of the full character. | trusted_official_docs | CPython Docs | Return a copy of the string with its first character capitalized and the rest lowercased.
.. versionchanged:: 3.8
The first character is now put into titlecase rather than uppercase. This means that characters like digraphs will only have their first
letter capitalized, instead of the full character. | Return a copy of the string with its first character capitalized and the rest lowercased.
.. versionchanged:: 3.8
The first character is now put into titlecase rather than uppercase. This means that characters like digraphs will only have their first
letter capitalized, instead of the full character. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d4309e34-4c25-496a-8138-1300352d2607 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,688 | supabase-export-v2 | e443f3056f71ad92 | the numeric operations and higher than the comparisons; the unary operation ``~`` has the same priority as the other unary numeric operations (``+`` and ``-``).
This table lists the bitwise operations sorted in ascending priority: | trusted_official_docs | CPython Docs | the numeric operations and higher than the comparisons; the unary operation ``~`` has the same priority as the other unary numeric operations (``+`` and ``-``).
This table lists the bitwise operations sorted in ascending priority: | the numeric operations and higher than the comparisons; the unary operation ``~`` has the same priority as the other unary numeric operations (``+`` and ``-``).
This table lists the bitwise operations sorted in ascending priority: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d4edf236-4d42-4817-8203-4016ab3e87f3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,888 | supabase-export-v2 | ff738e86363f7af5 | .. method:: bytearray.insert(index, value, /) list.insert(index, value, /) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.insert(index, value, /)
Insert *value* into *sequence* at the given *index*. This is equivalent to writing ``sequence[index:index] = [value]``. | trusted_official_docs | CPython Docs | .. method:: bytearray.insert(index, value, /) list.insert(index, value, /) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.insert(index, value, /)
Insert *value* into *sequence* at the given *index*. This is equivalent to writing ``sequence[index:index] = [value]``. | .. method:: bytearray.insert(index, value, /) list.insert(index, value, /) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.insert(index, value, /)
Insert *value* into *sequence* at the given *index*. This is equivalent to writing ``sequence[index:index] = [value]``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d5503bf0-8bb1-4edd-92e2-d2cc48b0e526 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,485 | supabase-export-v2 | 2fb6de669a68f8bc | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.ljust(width, fillbyte=b' ', /)
bytearray.ljust(width, fillbyte=b' ', /) | trusted_official_docs | CPython Docs | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.ljust(width, fillbyte=b' ', /)
bytearray.ljust(width, fillbyte=b' ', /) | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.ljust(width, fillbyte=b' ', /)
bytearray.ljust(width, fillbyte=b' ', /) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d567d532-9886-43b8-98d8-c27620e692e9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,886 | supabase-export-v2 | 5e6cbc52c279ec52 | .. method:: bytearray.extend(iterable, /) list.extend(iterable, /) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.extend(iterable, /)
Extend *sequence* with the contents of *iterable*. For the most part, this is the same as writing
``seq[len(seq):len(seq)] = iterable``. | trusted_official_docs | CPython Docs | .. method:: bytearray.extend(iterable, /) list.extend(iterable, /) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.extend(iterable, /)
Extend *sequence* with the contents of *iterable*. For the most part, this is the same as writing
``seq[len(seq):len(seq)] = iterable``. | .. method:: bytearray.extend(iterable, /) list.extend(iterable, /) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.extend(iterable, /)
Extend *sequence* with the contents of *iterable*. For the most part, this is the same as writing
``seq[len(seq):len(seq)] = iterable``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d599eba2-5aa0-42eb-8fa3-262bda30c89a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,720 | supabase-export-v2 | 4c9818e24d85f904 | byteorder='big', signed=False): if byteorder == 'little': order = range(length) elif byteorder == 'big': order = reversed(range(length)) else: raise ValueError("byteorder must be either 'little' or 'big'")
return bytes((n >> i*8) & 0xff for i in order) | trusted_official_docs | CPython Docs | byteorder='big', signed=False): if byteorder == 'little': order = range(length) elif byteorder == 'big': order = reversed(range(length)) else: raise ValueError("byteorder must be either 'little' or 'big'")
return bytes((n >> i*8) & 0xff for i in order) | byteorder='big', signed=False): if byteorder == 'little': order = range(length) elif byteorder == 'big': order = reversed(range(length)) else: raise ValueError("byteorder must be either 'little' or 'big'")
return bytes((n >> i*8) & 0xff for i in order) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d5de9435-63d9-40a1-ae33-c4aef1e0049d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,091 | supabase-export-v2 | 570359362ce7d850 | .. method:: str.join(iterable, /)
Return a string which is the concatenation of the strings in *iterable*. A :exc:`TypeError` will be raised if there are any non-string values in
*iterable*, including :class:`bytes` objects. The separator between
elements is the string providing this method. For example: | trusted_official_docs | CPython Docs | .. method:: str.join(iterable, /)
Return a string which is the concatenation of the strings in *iterable*. A :exc:`TypeError` will be raised if there are any non-string values in
*iterable*, including :class:`bytes` objects. The separator between
elements is the string providing this method. For example: | .. method:: str.join(iterable, /)
Return a string which is the concatenation of the strings in *iterable*. A :exc:`TypeError` will be raised if there are any non-string values in
*iterable*, including :class:`bytes` objects. The separator between
elements is the string providing this method. For example: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d67a0928-8f3b-4a16-88ef-7f8ccc08e717 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,923 | supabase-export-v2 | c621b67d1d3599cc | 'b', 'c')`` and ``tuple( [1, 2, 3] )`` returns ``(1, 2, 3)``. If no argument is given, the constructor creates a new empty tuple, ``()``.
Note that it is actually the comma which makes a tuple, not the parentheses. The parentheses are optional, except in the empty tuple case, or
when they are needed to avoid syntactic... | trusted_official_docs | CPython Docs | 'b', 'c')`` and ``tuple( [1, 2, 3] )`` returns ``(1, 2, 3)``. If no argument is given, the constructor creates a new empty tuple, ``()``.
Note that it is actually the comma which makes a tuple, not the parentheses. The parentheses are optional, except in the empty tuple case, or
when they are needed to avoid syntactic... | 'b', 'c')`` and ``tuple( [1, 2, 3] )`` returns ``(1, 2, 3)``. If no argument is given, the constructor creates a new empty tuple, ``()``.
Note that it is actually the comma which makes a tuple, not the parentheses. The parentheses are optional, except in the empty tuple case, or
when they are needed to avoid syntactic... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d861c8e5-dcc7-422d-b7c2-0b6e95c3eb4e | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,180 | supabase-export-v2 | dbad289c96bd0aa3 | .. method:: str.splitlines(keepends=False)
Return a list of the lines in the string, breaking at line boundaries. Line
breaks are not included in the resulting list unless *keepends* is given and
true. | trusted_official_docs | CPython Docs | .. method:: str.splitlines(keepends=False)
Return a list of the lines in the string, breaking at line boundaries. Line
breaks are not included in the resulting list unless *keepends* is given and
true. | .. method:: str.splitlines(keepends=False)
Return a list of the lines in the string, breaking at line boundaries. Line
breaks are not included in the resulting list unless *keepends* is given and
true. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d877edac-809e-4d48-89ee-8afc4fb4639a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,785 | supabase-export-v2 | fd665d39a9fbdee0 | if m and n already coprime.) while m % P == n % P == 0: m, n = m // P, n // P
if n % P == 0:
hash_value = sys.hash_info.inf
else:
# Fermat's Little Theorem: pow(n, P-1, P) is 1, so
# pow(n, P-2, P) gives the inverse of n modulo P. hash_value = (abs(m) % P) * pow(n, P - 2, P) % P
if m < 0:
hash_value = -hash_value... | trusted_official_docs | CPython Docs | if m and n already coprime.) while m % P == n % P == 0: m, n = m // P, n // P
if n % P == 0:
hash_value = sys.hash_info.inf
else:
# Fermat's Little Theorem: pow(n, P-1, P) is 1, so
# pow(n, P-2, P) gives the inverse of n modulo P. hash_value = (abs(m) % P) * pow(n, P - 2, P) % P
if m < 0:
hash_value = -hash_value... | if m and n already coprime.) while m % P == n % P == 0: m, n = m // P, n // P
if n % P == 0:
hash_value = sys.hash_info.inf
else:
# Fermat's Little Theorem: pow(n, P-1, P) is 1, so
# pow(n, P-2, P) gives the inverse of n modulo P. hash_value = (abs(m) % P) * pow(n, P - 2, P) % P
if m < 0:
hash_value = -hash_value... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d8e337f2-5bb7-4c36-bb87-05ac2e2b04df | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,473 | supabase-export-v2 | 2ffa9dfeb40af464 | also be a tuple of prefixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position.
The prefix(es) to search for may be any :term:`bytes-like object`. | trusted_official_docs | CPython Docs | also be a tuple of prefixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position.
The prefix(es) to search for may be any :term:`bytes-like object`. | also be a tuple of prefixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position.
The prefix(es) to search for may be any :term:`bytes-like object`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d97a2e6a-e1fe-4eb0-93e1-0c33710d37fe | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,798 | supabase-export-v2 | 2a638a835db69862 | The use of the bitwise inversion operator ``~`` is deprecated and will raise an error in Python 3.16.
:class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In
many numeric contexts, ``False`` and ``True`` behave like the integers 0 and 1, respectively. However, relying on this is discouraged; explicitl... | trusted_official_docs | CPython Docs | The use of the bitwise inversion operator ``~`` is deprecated and will raise an error in Python 3.16.
:class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In
many numeric contexts, ``False`` and ``True`` behave like the integers 0 and 1, respectively. However, relying on this is discouraged; explicitl... | The use of the bitwise inversion operator ``~`` is deprecated and will raise an error in Python 3.16.
:class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In
many numeric contexts, ``False`` and ``True`` behave like the integers 0 and 1, respectively. However, relying on this is discouraged; explicitl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d9ab641f-765d-4a61-9c7f-2f8ddeac6aae | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,890 | supabase-export-v2 | 2cf8d5e4edae9399 | .. method:: bytearray.pop(index=-1, /) list.pop(index=-1, /) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.pop(index=-1, /)
Retrieve the item at *index* and also removes it from *sequence*. By default, the last item in *sequence* is removed and returned. | trusted_official_docs | CPython Docs | .. method:: bytearray.pop(index=-1, /) list.pop(index=-1, /) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.pop(index=-1, /)
Retrieve the item at *index* and also removes it from *sequence*. By default, the last item in *sequence* is removed and returned. | .. method:: bytearray.pop(index=-1, /) list.pop(index=-1, /) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.pop(index=-1, /)
Retrieve the item at *index* and also removes it from *sequence*. By default, the last item in *sequence* is removed and returned. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d9cee9d2-8158-44b3-b65d-697a7925a708 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,146 | supabase-export-v2 | 74cd9445593b3e56 | spam'.rindex('spam') 12 >>> 'spam, spam, spam'.rindex('eggs') Traceback (most recent call last): File "<stdin-0>", line 1, in <module> 'spam, spam, spam'.rindex('eggs') ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ ValueError: substring not found
See also :meth:`index` and :meth:`find`. | trusted_official_docs | CPython Docs | spam'.rindex('spam') 12 >>> 'spam, spam, spam'.rindex('eggs') Traceback (most recent call last): File "<stdin-0>", line 1, in <module> 'spam, spam, spam'.rindex('eggs') ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ ValueError: substring not found
See also :meth:`index` and :meth:`find`. | spam'.rindex('spam') 12 >>> 'spam, spam, spam'.rindex('eggs') Traceback (most recent call last): File "<stdin-0>", line 1, in <module> 'spam, spam, spam'.rindex('eggs') ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ ValueError: substring not found
See also :meth:`index` and :meth:`find`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
da42d428-5f97-447a-a68e-46597328e4ca | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,675 | supabase-export-v2 | a6f8c2ccb082865a | float also accepts the strings "nan" and "inf" with an optional prefix "+" or "-" for Not a Number (NaN) and positive or negative infinity.
(5)
Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for
programming languages. | trusted_official_docs | CPython Docs | float also accepts the strings "nan" and "inf" with an optional prefix "+" or "-" for Not a Number (NaN) and positive or negative infinity.
(5)
Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for
programming languages. | float also accepts the strings "nan" and "inf" with an optional prefix "+" or "-" for Not a Number (NaN) and positive or negative infinity.
(5)
Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for
programming languages. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
da61a611-e6a9-4561-8e46-4cde90762d92 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,059 | supabase-export-v2 | 4c8d497941b21b3a | Return ``True`` if the string is a valid identifier according to the language definition, section :ref:`identifiers`.
:func:`keyword.iskeyword` can be used to test whether string ``s`` is a reserved
identifier, such as :keyword:`def` and :keyword:`class`. | trusted_official_docs | CPython Docs | Return ``True`` if the string is a valid identifier according to the language definition, section :ref:`identifiers`.
:func:`keyword.iskeyword` can be used to test whether string ``s`` is a reserved
identifier, such as :keyword:`def` and :keyword:`class`. | Return ``True`` if the string is a valid identifier according to the language definition, section :ref:`identifiers`.
:func:`keyword.iskeyword` can be used to test whether string ``s`` is a reserved
identifier, such as :keyword:`def` and :keyword:`class`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dda9c213-decb-49a1-b6d5-5fe2b4aa544d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,223 | supabase-export-v2 | 6f96e72ffb7a9152 | .. method:: str.translate(table, /)
Return a copy of the string in which each character has been mapped through
the given translation table. The table must be an object that implements
indexing via :meth:`~object.__getitem__`, typically a :term:`mapping` or
:term:`sequence`. When indexed by a Unicode ordinal (an int... | trusted_official_docs | CPython Docs | .. method:: str.translate(table, /)
Return a copy of the string in which each character has been mapped through
the given translation table. The table must be an object that implements
indexing via :meth:`~object.__getitem__`, typically a :term:`mapping` or
:term:`sequence`. When indexed by a Unicode ordinal (an int... | .. method:: str.translate(table, /)
Return a copy of the string in which each character has been mapped through
the given translation table. The table must be an object that implements
indexing via :meth:`~object.__getitem__`, typically a :term:`mapping` or
:term:`sequence`. When indexed by a Unicode ordinal (an int... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ddd2d3ca-75dc-4674-b448-98caadb41b7c | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,311 | supabase-export-v2 | 7b24fce3f053469e | The precision determines the number of digits after the decimal point and defaults to 6.
(4)
The alternate form causes the result to always contain a decimal point, and
trailing zeroes are not removed as they would otherwise be. | trusted_official_docs | CPython Docs | The precision determines the number of digits after the decimal point and defaults to 6.
(4)
The alternate form causes the result to always contain a decimal point, and
trailing zeroes are not removed as they would otherwise be. | The precision determines the number of digits after the decimal point and defaults to 6.
(4)
The alternate form causes the result to always contain a decimal point, and
trailing zeroes are not removed as they would otherwise be. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
de0bd0da-87d5-4b62-898c-84ff9febeb58 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,427 | supabase-export-v2 | cd7c44cf9cfc4e0c | ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``, and any other name registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details.
For performance reasons, the value of *errors* is not checked for validity
unless a decod... | trusted_official_docs | CPython Docs | ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``, and any other name registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details.
For performance reasons, the value of *errors* is not checked for validity
unless a decod... | ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``, and any other name registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details.
For performance reasons, the value of *errors* is not checked for validity
unless a decod... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
de15f166-8cf4-45fa-acf2-f0782faa4b2b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,724 | supabase-export-v2 | 0276bf8487f852bc | Return the integer represented by the given array of bytes.
>>> int.from_bytes(b'\x00\x10', byteorder='big')
16
>>> int.from_bytes(b'\x00\x10', byteorder='little')
4096
>>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=True)
-1024
>>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=False)
64512
>>> in... | trusted_official_docs | CPython Docs | Return the integer represented by the given array of bytes.
>>> int.from_bytes(b'\x00\x10', byteorder='big')
16
>>> int.from_bytes(b'\x00\x10', byteorder='little')
4096
>>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=True)
-1024
>>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=False)
64512
>>> in... | Return the integer represented by the given array of bytes.
>>> int.from_bytes(b'\x00\x10', byteorder='big')
16
>>> int.from_bytes(b'\x00\x10', byteorder='little')
4096
>>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=True)
-1024
>>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=False)
64512
>>> in... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dea95b8f-d4c6-4ec5-81d0-3689de76f97a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,795 | supabase-export-v2 | 7bb73c1a99e2150f | The built-in function :func:`bool` converts any value to a boolean, if the value can be interpreted as a truth value (see section :ref:`truth` above).
For logical operations, use the :ref:`boolean operators <boolean>` ``and``,
``or`` and ``not``. When applying the bitwise operators ``&``, ``|``, ``^`` to two booleans, ... | trusted_official_docs | CPython Docs | The built-in function :func:`bool` converts any value to a boolean, if the value can be interpreted as a truth value (see section :ref:`truth` above).
For logical operations, use the :ref:`boolean operators <boolean>` ``and``,
``or`` and ``not``. When applying the bitwise operators ``&``, ``|``, ``^`` to two booleans, ... | The built-in function :func:`bool` converts any value to a boolean, if the value can be interpreted as a truth value (see section :ref:`truth` above).
For logical operations, use the :ref:`boolean operators <boolean>` ``and``,
``or`` and ``not``. When applying the bitwise operators ``&``, ``|``, ``^`` to two booleans, ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dee9fbcc-a94c-4c35-ab67-0dde250febc6 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,509 | supabase-export-v2 | d357cf285717306c | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.split(sep=None, maxsplit=-1)
bytearray.split(sep=None, maxsplit=-1) | trusted_official_docs | CPython Docs | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.split(sep=None, maxsplit=-1)
bytearray.split(sep=None, maxsplit=-1) | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.split(sep=None, maxsplit=-1)
bytearray.split(sep=None, maxsplit=-1) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dfc07c13-0990-4154-bfd3-d01f4868e54b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,031 | supabase-export-v2 | a87aee81f79900c9 | to ``str.format(**mapping)``, except that ``mapping`` is used directly and not copied to a :class:`dict`. This is useful if for example ``mapping`` is a dict subclass:
>>> class Default(dict):
... def __missing__(self, key):
... return key
... >>> '{name} was born in {country}'.format_map(Default(name='Guido'))
'Gu... | trusted_official_docs | CPython Docs | to ``str.format(**mapping)``, except that ``mapping`` is used directly and not copied to a :class:`dict`. This is useful if for example ``mapping`` is a dict subclass:
>>> class Default(dict):
... def __missing__(self, key):
... return key
... >>> '{name} was born in {country}'.format_map(Default(name='Guido'))
'Gu... | to ``str.format(**mapping)``, except that ``mapping`` is used directly and not copied to a :class:`dict`. This is useful if for example ``mapping`` is a dict subclass:
>>> class Default(dict):
... def __missing__(self, key):
... return key
... >>> '{name} was born in {country}'.format_map(Default(name='Guido'))
'Gu... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dfcd0ddd-bbda-459c-8bdd-b8ebf2b6703a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,279 | supabase-export-v2 | e5aeef1746b8f8e0 | the :meth:`str.format` interface, or :class:`string.Template` may help avoid these errors. Each of these alternatives provides their own trade-offs and benefits of simplicity, flexibility, and/or extensibility.
String objects have one unique built-in operation: the ``%`` operator (modulo). This is also known as the str... | trusted_official_docs | CPython Docs | the :meth:`str.format` interface, or :class:`string.Template` may help avoid these errors. Each of these alternatives provides their own trade-offs and benefits of simplicity, flexibility, and/or extensibility.
String objects have one unique built-in operation: the ``%`` operator (modulo). This is also known as the str... | the :meth:`str.format` interface, or :class:`string.Template` may help avoid these errors. Each of these alternatives provides their own trade-offs and benefits of simplicity, flexibility, and/or extensibility.
String objects have one unique built-in operation: the ``%`` operator (modulo). This is also known as the str... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e0152c7f-32cd-4f69-b239-12d02e4b60b4 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,714 | supabase-export-v2 | 6c9a0815822cedf8 | byte is at the beginning of the byte array. If *byteorder* is ``"little"``, the most significant byte is at the end of the byte array.
The *signed* argument determines whether two's complement is used to
represent the integer. If *signed* is ``False`` and a negative integer is
given, an :exc:`OverflowError` is raised... | trusted_official_docs | CPython Docs | byte is at the beginning of the byte array. If *byteorder* is ``"little"``, the most significant byte is at the end of the byte array.
The *signed* argument determines whether two's complement is used to
represent the integer. If *signed* is ``False`` and a negative integer is
given, an :exc:`OverflowError` is raised... | byte is at the beginning of the byte array. If *byteorder* is ``"little"``, the most significant byte is at the end of the byte array.
The *signed* argument determines whether two's complement is used to
represent the integer. If *signed* is ``False`` and a negative integer is
given, an :exc:`OverflowError` is raised... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e043e8fd-cecf-46fa-84fd-f4f1e32758e1 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,679 | supabase-export-v2 | 093ad51e5e746642 | are equal if their shapes are equivalent and if all corresponding values are equal when the operands' respective format codes are interpreted using :mod:`struct` syntax.
For the subset of :mod:`struct` format strings currently supported by
:meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``:: | trusted_official_docs | CPython Docs | are equal if their shapes are equivalent and if all corresponding values are equal when the operands' respective format codes are interpreted using :mod:`struct` syntax.
For the subset of :mod:`struct` format strings currently supported by
:meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``:: | are equal if their shapes are equivalent and if all corresponding values are equal when the operands' respective format codes are interpreted using :mod:`struct` syntax.
For the subset of :mod:`struct` format strings currently supported by
:meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e0a52fe2-7f92-4d35-9ba6-2ae60940bf28 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,403 | supabase-export-v2 | dd41e6528a5cfc84 | .. note:: Using these ASCII based operations to manipulate binary data that is not stored in an ASCII based format may lead to data corruption.
The following methods on bytes and bytearray objects can be used with
arbitrary binary data. | trusted_official_docs | CPython Docs | .. note:: Using these ASCII based operations to manipulate binary data that is not stored in an ASCII based format may lead to data corruption.
The following methods on bytes and bytearray objects can be used with
arbitrary binary data. | .. note:: Using these ASCII based operations to manipulate binary data that is not stored in an ASCII based format may lead to data corruption.
The following methods on bytes and bytearray objects can be used with
arbitrary binary data. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e0cb47cc-1e23-4af0-9dda-3f825cab1290 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,469 | supabase-export-v2 | 5de59b91823ed560 | .. method:: bytes.rpartition(sep, /) bytearray.rpartition(sep, /)
Split the sequence at the last occurrence of *sep*, and return a 3-tuple
containing the part before the separator, the separator itself or its
bytearray copy, and the part after the separator. If the separator is not found, return a 3-tuple
containing... | trusted_official_docs | CPython Docs | .. method:: bytes.rpartition(sep, /) bytearray.rpartition(sep, /)
Split the sequence at the last occurrence of *sep*, and return a 3-tuple
containing the part before the separator, the separator itself or its
bytearray copy, and the part after the separator. If the separator is not found, return a 3-tuple
containing... | .. method:: bytes.rpartition(sep, /) bytearray.rpartition(sep, /)
Split the sequence at the last occurrence of *sep*, and return a 3-tuple
containing the part before the separator, the separator itself or its
bytearray copy, and the part after the separator. If the separator is not found, return a 3-tuple
containing... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e1e091cc-6602-4cb7-98a0-9c0d56ddde52 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,181 | supabase-export-v2 | 8407f223781edd78 | of the lines in the string, breaking at line boundaries. Line breaks are not included in the resulting list unless *keepends* is given and true.
This method splits on the following line boundaries. In particular, the
boundaries are a superset of :term:`universal newlines`. | trusted_official_docs | CPython Docs | of the lines in the string, breaking at line boundaries. Line breaks are not included in the resulting list unless *keepends* is given and true.
This method splits on the following line boundaries. In particular, the
boundaries are a superset of :term:`universal newlines`. | of the lines in the string, breaking at line boundaries. Line breaks are not included in the resulting list unless *keepends* is given and true.
This method splits on the following line boundaries. In particular, the
boundaries are a superset of :term:`universal newlines`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e341583b-a82e-4086-9370-8bd403500e82 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,294 | supabase-export-v2 | d18f2f8dd7747fdc | >>> print('%(language)s has %(number)03d quote types.' % ... {'language': "Python", "number": 2}) Python has 002 quote types.
In this case no ``*`` specifiers may occur in a format (since they require a
sequential parameter list). | trusted_official_docs | CPython Docs | >>> print('%(language)s has %(number)03d quote types.' % ... {'language': "Python", "number": 2}) Python has 002 quote types.
In this case no ``*`` specifiers may occur in a format (since they require a
sequential parameter list). | >>> print('%(language)s has %(number)03d quote types.' % ... {'language': "Python", "number": 2}) Python has 002 quote types.
In this case no ``*`` specifiers may occur in a format (since they require a
sequential parameter list). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e3b65330-987b-47c5-b031-839bb963ae4b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,824 | supabase-export-v2 | 24b04fa4aecef50c | same type, *n*, *i*, *j* and *k* are integers and *x* is an arbitrary object that meets any type and value restrictions imposed by *s*.
The ``in`` and ``not in`` operations have the same priorities as the
comparison operations. The ``+`` (concatenation) and ``*`` (repetition)
operations have the same priority as the co... | trusted_official_docs | CPython Docs | same type, *n*, *i*, *j* and *k* are integers and *x* is an arbitrary object that meets any type and value restrictions imposed by *s*.
The ``in`` and ``not in`` operations have the same priorities as the
comparison operations. The ``+`` (concatenation) and ``*`` (repetition)
operations have the same priority as the co... | same type, *n*, *i*, *j* and *k* are integers and *x* is an arbitrary object that meets any type and value restrictions imposed by *s*.
The ``in`` and ``not in`` operations have the same priorities as the
comparison operations. The ``+`` (concatenation) and ``*`` (repetition)
operations have the same priority as the co... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e40aba68-c2e4-4c97-9fff-d86e03464d3c | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,958 | supabase-export-v2 | a0ceb34f9af7cb2d | Text Sequence Type --- :class:`str` ===================================
Textual data in Python is handled with :class:`str` objects, or :dfn:`strings`. Strings are immutable
:ref:`sequences <typesseq>` of Unicode code points. String literals are
written in a variety of ways: | trusted_official_docs | CPython Docs | Text Sequence Type --- :class:`str` ===================================
Textual data in Python is handled with :class:`str` objects, or :dfn:`strings`. Strings are immutable
:ref:`sequences <typesseq>` of Unicode code points. String literals are
written in a variety of ways: | Text Sequence Type --- :class:`str` ===================================
Textual data in Python is handled with :class:`str` objects, or :dfn:`strings`. Strings are immutable
:ref:`sequences <typesseq>` of Unicode code points. String literals are
written in a variety of ways: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e428ee87-42ad-48c8-8800-4a042cfcbef8 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,338 | supabase-export-v2 | c571c0697d962586 | .. classmethod:: fromhex(string, /)
This :class:`bytes` class method returns a bytes object, decoding the
given string object. The string must contain two hexadecimal digits per
byte, with ASCII whitespace being ignored. | trusted_official_docs | CPython Docs | .. classmethod:: fromhex(string, /)
This :class:`bytes` class method returns a bytes object, decoding the
given string object. The string must contain two hexadecimal digits per
byte, with ASCII whitespace being ignored. | .. classmethod:: fromhex(string, /)
This :class:`bytes` class method returns a bytes object, decoding the
given string object. The string must contain two hexadecimal digits per
byte, with ASCII whitespace being ignored. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e44e4b2c-7d80-4381-b2c0-748861cb695f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,056 | supabase-export-v2 | 4a521f2a477bff30 | .. method:: str.isdigit()
Return ``True`` if all characters in the string are digits and there is at least one
character, ``False`` otherwise. Digits include decimal characters and digits that need
special handling, such as the compatibility superscript digits. This covers digits which cannot be used to form numbers ... | trusted_official_docs | CPython Docs | .. method:: str.isdigit()
Return ``True`` if all characters in the string are digits and there is at least one
character, ``False`` otherwise. Digits include decimal characters and digits that need
special handling, such as the compatibility superscript digits. This covers digits which cannot be used to form numbers ... | .. method:: str.isdigit()
Return ``True`` if all characters in the string are digits and there is at least one
character, ``False`` otherwise. Digits include decimal characters and digits that need
special handling, such as the compatibility superscript digits. This covers digits which cannot be used to form numbers ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e47b442c-2ff0-4132-a4a5-c057ce2e190b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,402 | supabase-export-v2 | 3027f7fc333939b9 | operations assume the use of ASCII compatible binary formats, and hence should be avoided when working with arbitrary binary data. These restrictions are covered below.
.. note::
Using these ASCII based operations to manipulate binary data that is not
stored in an ASCII based format may lead to data corruption. | trusted_official_docs | CPython Docs | operations assume the use of ASCII compatible binary formats, and hence should be avoided when working with arbitrary binary data. These restrictions are covered below.
.. note::
Using these ASCII based operations to manipulate binary data that is not
stored in an ASCII based format may lead to data corruption. | operations assume the use of ASCII compatible binary formats, and hence should be avoided when working with arbitrary binary data. These restrictions are covered below.
.. note::
Using these ASCII based operations to manipulate binary data that is not
stored in an ASCII based format may lead to data corruption. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e4855519-9a6e-4c04-8084-88e8c682885e | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,981 | supabase-export-v2 | 1e45ecb3850b3697 | Strings implement all of the :ref:`common <typesseq-common>` sequence operations, along with the additional methods described below.
Strings also support two styles of string formatting, one providing a large
degree of flexibility and customization (see :meth:`str.format`,
:ref:`formatstrings` and :ref:`string-formatti... | trusted_official_docs | CPython Docs | Strings implement all of the :ref:`common <typesseq-common>` sequence operations, along with the additional methods described below.
Strings also support two styles of string formatting, one providing a large
degree of flexibility and customization (see :meth:`str.format`,
:ref:`formatstrings` and :ref:`string-formatti... | Strings implement all of the :ref:`common <typesseq-common>` sequence operations, along with the additional methods described below.
Strings also support two styles of string formatting, one providing a large
degree of flexibility and customization (see :meth:`str.format`,
:ref:`formatstrings` and :ref:`string-formatti... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e5b1fb0f-ba0b-4b32-9675-fdb38c686dd9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,555 | supabase-export-v2 | 8e476747082bdcb1 | .. method:: bytes.isspace() bytearray.isspace()
Return ``True`` if all bytes in the sequence are ASCII whitespace and the
sequence is not empty, ``False`` otherwise. ASCII whitespace characters are
those byte values in the sequence ``b' \t\n\r\x0b\f'`` (space, tab, newline,
carriage return, vertical tab, form feed). | trusted_official_docs | CPython Docs | .. method:: bytes.isspace() bytearray.isspace()
Return ``True`` if all bytes in the sequence are ASCII whitespace and the
sequence is not empty, ``False`` otherwise. ASCII whitespace characters are
those byte values in the sequence ``b' \t\n\r\x0b\f'`` (space, tab, newline,
carriage return, vertical tab, form feed). | .. method:: bytes.isspace() bytearray.isspace()
Return ``True`` if all bytes in the sequence are ASCII whitespace and the
sequence is not empty, ``False`` otherwise. ASCII whitespace characters are
those byte values in the sequence ``b' \t\n\r\x0b\f'`` (space, tab, newline,
carriage return, vertical tab, form feed). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e6f4572b-2f9c-491c-b874-cb24815f1401 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,661 | supabase-export-v2 | c071043bcd62be95 | :meth:`~memoryview.tolist`, which is the nested list representation of the view. If ``view.ndim = 1``, this is equal to the number of elements in the view.
.. versionchanged:: 3.12
If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of returning 1. | trusted_official_docs | CPython Docs | :meth:`~memoryview.tolist`, which is the nested list representation of the view. If ``view.ndim = 1``, this is equal to the number of elements in the view.
.. versionchanged:: 3.12
If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of returning 1. | :meth:`~memoryview.tolist`, which is the nested list representation of the view. If ``view.ndim = 1``, this is equal to the number of elements in the view.
.. versionchanged:: 3.12
If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of returning 1. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e723aca8-64b6-4b59-b79c-baeed2e549ba | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,922 | supabase-export-v2 | a436ce95eec381f4 | singleton tuple: ``a,`` or ``(a,)`` * Separating items with commas: ``a, b, c`` or ``(a, b, c)`` * Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``
The constructor builds a tuple whose items are the same and in the same
order as *iterable*'s items. *iterable* may be either a sequence, a
container ... | trusted_official_docs | CPython Docs | singleton tuple: ``a,`` or ``(a,)`` * Separating items with commas: ``a, b, c`` or ``(a, b, c)`` * Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``
The constructor builds a tuple whose items are the same and in the same
order as *iterable*'s items. *iterable* may be either a sequence, a
container ... | singleton tuple: ``a,`` or ``(a,)`` * Separating items with commas: ``a, b, c`` or ``(a, b, c)`` * Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``
The constructor builds a tuple whose items are the same and in the same
order as *iterable*'s items. *iterable* may be either a sequence, a
container ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e96ba7ab-823f-4a63-a0d9-3c547cce7b65 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,505 | supabase-export-v2 | 40a9ec544f203d80 | >>> b' spacious '.rstrip() b' spacious' >>> b'mississippi'.rstrip(b'ipz') b'mississ'
The binary sequence of byte values to remove may be any
:term:`bytes-like object`. See :meth:`~bytes.removesuffix` for a method
that will remove a single suffix string rather than all of a set of
characters. For example:: | trusted_official_docs | CPython Docs | >>> b' spacious '.rstrip() b' spacious' >>> b'mississippi'.rstrip(b'ipz') b'mississ'
The binary sequence of byte values to remove may be any
:term:`bytes-like object`. See :meth:`~bytes.removesuffix` for a method
that will remove a single suffix string rather than all of a set of
characters. For example:: | >>> b' spacious '.rstrip() b' spacious' >>> b'mississippi'.rstrip(b'ipz') b'mississ'
The binary sequence of byte values to remove may be any
:term:`bytes-like object`. See :meth:`~bytes.removesuffix` for a method
that will remove a single suffix string rather than all of a set of
characters. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ead3c81e-e304-4628-8bcc-2243e0a467b9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,016 | supabase-export-v2 | e96cb609548a074d | .. method:: str.find(sub[, start[, end]])
Return the lowest index in the string where substring *sub* is found within
the slice ``s[start:end]``. Optional arguments *start* and *end* are
interpreted as in slice notation. Return ``-1`` if *sub* is not found. For example:: | trusted_official_docs | CPython Docs | .. method:: str.find(sub[, start[, end]])
Return the lowest index in the string where substring *sub* is found within
the slice ``s[start:end]``. Optional arguments *start* and *end* are
interpreted as in slice notation. Return ``-1`` if *sub* is not found. For example:: | .. method:: str.find(sub[, start[, end]])
Return the lowest index in the string where substring *sub* is found within
the slice ``s[start:end]``. Optional arguments *start* and *end* are
interpreted as in slice notation. Return ``-1`` if *sub* is not found. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eb461190-9d43-451a-9c4c-c7671bb6f568 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,711 | supabase-export-v2 | beade4b3c626ff30 | Return an array of bytes representing an integer.
>>> (1024).to_bytes(2, byteorder='big')
b'\x04\x00'
>>> (1024).to_bytes(10, byteorder='big')
b'\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00'
>>> (-1024).to_bytes(10, byteorder='big', signed=True)
b'\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x00'
>>> x = 1000
>>> x.to_bytes... | trusted_official_docs | CPython Docs | Return an array of bytes representing an integer.
>>> (1024).to_bytes(2, byteorder='big')
b'\x04\x00'
>>> (1024).to_bytes(10, byteorder='big')
b'\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00'
>>> (-1024).to_bytes(10, byteorder='big', signed=True)
b'\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x00'
>>> x = 1000
>>> x.to_bytes... | Return an array of bytes representing an integer.
>>> (1024).to_bytes(2, byteorder='big')
b'\x04\x00'
>>> (1024).to_bytes(10, byteorder='big')
b'\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00'
>>> (-1024).to_bytes(10, byteorder='big', signed=True)
b'\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x00'
>>> x = 1000
>>> x.to_bytes... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eb67be64-2d0b-4cb6-a313-6df9062c6a23 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,680 | supabase-export-v2 | 693e2dbe9cf5d10c | For the subset of :mod:`struct` format strings currently supported by :meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::
>>> import array
>>> a = array.array('I', [1, 2, 3, 4, 5])
>>> b = array.array('d', [1.0, 2.0, 3.0, 4.0, 5.0])
>>> c = array.array('b', [5, 3, 1])
>>> x = memoryview(a)
... | trusted_official_docs | CPython Docs | For the subset of :mod:`struct` format strings currently supported by :meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::
>>> import array
>>> a = array.array('I', [1, 2, 3, 4, 5])
>>> b = array.array('d', [1.0, 2.0, 3.0, 4.0, 5.0])
>>> c = array.array('b', [5, 3, 1])
>>> x = memoryview(a)
... | For the subset of :mod:`struct` format strings currently supported by :meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::
>>> import array
>>> a = array.array('I', [1, 2, 3, 4, 5])
>>> b = array.array('d', [1.0, 2.0, 3.0, 4.0, 5.0])
>>> c = array.array('b', [5, 3, 1])
>>> x = memoryview(a)
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ebd892ba-88ee-4e3f-bb7e-7920b3b3488f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,725 | supabase-export-v2 | 83fe4ea09c0a78d6 | >>> int.from_bytes(b'\x00\x10', byteorder='big') 16 >>> int.from_bytes(b'\x00\x10', byteorder='little') 4096 >>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=True) -1024 >>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=False) 64512 >>> int.from_bytes([255, 0, 0], byteorder='big') 16711680
The argument *by... | trusted_official_docs | CPython Docs | >>> int.from_bytes(b'\x00\x10', byteorder='big') 16 >>> int.from_bytes(b'\x00\x10', byteorder='little') 4096 >>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=True) -1024 >>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=False) 64512 >>> int.from_bytes([255, 0, 0], byteorder='big') 16711680
The argument *by... | >>> int.from_bytes(b'\x00\x10', byteorder='big') 16 >>> int.from_bytes(b'\x00\x10', byteorder='little') 4096 >>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=True) -1024 >>> int.from_bytes(b'\xfc\x00', byteorder='big', signed=False) 64512 >>> int.from_bytes([255, 0, 0], byteorder='big') 16711680
The argument *by... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eca0c3af-b92d-496e-9fe1-834a2d544550 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,845 | supabase-export-v2 | 5289dab7334d577a | similarly use :meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :class:`bytearray` object. :class:`bytearray` objects are mutable and have an efficient overallocation mechanism
* if concatenating :class:`tuple` objects, extend a :class:`list` instead | trusted_official_docs | CPython Docs | similarly use :meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :class:`bytearray` object. :class:`bytearray` objects are mutable and have an efficient overallocation mechanism
* if concatenating :class:`tuple` objects, extend a :class:`list` instead | similarly use :meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :class:`bytearray` object. :class:`bytearray` objects are mutable and have an efficient overallocation mechanism
* if concatenating :class:`tuple` objects, extend a :class:`list` instead | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ee306ada-6ed8-485f-b409-5376ff902527 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,643 | supabase-export-v2 | bc03b7f00ce6c101 | .. index:: pair: object; numeric pair: objects; comparing
Unless stated otherwise, objects of different types never compare equal. The ``==`` operator is always defined but for some object types (for example,
class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, ``>`` and ``>=``
operators are only defined w... | trusted_official_docs | CPython Docs | .. index:: pair: object; numeric pair: objects; comparing
Unless stated otherwise, objects of different types never compare equal. The ``==`` operator is always defined but for some object types (for example,
class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, ``>`` and ``>=``
operators are only defined w... | .. index:: pair: object; numeric pair: objects; comparing
Unless stated otherwise, objects of different types never compare equal. The ``==`` operator is always defined but for some object types (for example,
class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, ``>`` and ``>=``
operators are only defined w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
efcf7990-a44f-448a-bc92-cc1b06b243bf | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,649 | supabase-export-v2 | 4a1bd0ce86f3c174 | .. index:: pair: operator; in pair: operator; not in
Two more operations with the same syntactic priority, :keyword:`in` and
:keyword:`not in`, are supported by types that are :term:`iterable` or
implement the :meth:`~object.__contains__` method. | trusted_official_docs | CPython Docs | .. index:: pair: operator; in pair: operator; not in
Two more operations with the same syntactic priority, :keyword:`in` and
:keyword:`not in`, are supported by types that are :term:`iterable` or
implement the :meth:`~object.__contains__` method. | .. index:: pair: operator; in pair: operator; not in
Two more operations with the same syntactic priority, :keyword:`in` and
:keyword:`not in`, are supported by types that are :term:`iterable` or
implement the :meth:`~object.__contains__` method. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
efdbc3ef-ba92-4e3f-abbf-348faa9c70c9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,842 | supabase-export-v2 | 27720afc30b91286 | become "end" values (which end depends on the sign of *k*). Note, *k* cannot be zero. If *k* is ``None``, it is treated like ``1``.
(6)
Concatenating immutable sequences always results in a new object. This
means that building up a sequence by repeated concatenation will have a
quadratic runtime cost in the total se... | trusted_official_docs | CPython Docs | become "end" values (which end depends on the sign of *k*). Note, *k* cannot be zero. If *k* is ``None``, it is treated like ``1``.
(6)
Concatenating immutable sequences always results in a new object. This
means that building up a sequence by repeated concatenation will have a
quadratic runtime cost in the total se... | become "end" values (which end depends on the sign of *k*). Note, *k* cannot be zero. If *k* is ``None``, it is treated like ``1``.
(6)
Concatenating immutable sequences always results in a new object. This
means that building up a sequence by repeated concatenation will have a
quadratic runtime cost in the total se... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f0a54a75-1ca0-4387-ae79-6f99fbc5e926 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,948 | supabase-export-v2 | 8961bd70b35184cc | versionchanged:: 3.2 Implement the Sequence ABC. Support slicing and negative indices. Test :class:`int` objects for membership in constant time instead of iterating through all items.
.. versionchanged:: 3.3
Define '==' and '!=' to compare range objects based on the
sequence of values they define (instead of compari... | trusted_official_docs | CPython Docs | versionchanged:: 3.2 Implement the Sequence ABC. Support slicing and negative indices. Test :class:`int` objects for membership in constant time instead of iterating through all items.
.. versionchanged:: 3.3
Define '==' and '!=' to compare range objects based on the
sequence of values they define (instead of compari... | versionchanged:: 3.2 Implement the Sequence ABC. Support slicing and negative indices. Test :class:`int` objects for membership in constant time instead of iterating through all items.
.. versionchanged:: 3.3
Define '==' and '!=' to compare range objects based on the
sequence of values they define (instead of compari... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f120c139-53ce-418e-944f-a1d0ce0de163 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,873 | supabase-export-v2 | aa99e780c7c61d90 | (1) If *k* is not equal to ``1``, *t* must have the same length as the slice it is replacing.
(2)
The value *n* is an integer, or an object implementing
:meth:`~object.__index__`. Zero and negative values of *n* clear
the sequence. Items in the sequence are not copied; they are referenced
multiple times, as explain... | trusted_official_docs | CPython Docs | (1) If *k* is not equal to ``1``, *t* must have the same length as the slice it is replacing.
(2)
The value *n* is an integer, or an object implementing
:meth:`~object.__index__`. Zero and negative values of *n* clear
the sequence. Items in the sequence are not copied; they are referenced
multiple times, as explain... | (1) If *k* is not equal to ``1``, *t* must have the same length as the slice it is replacing.
(2)
The value *n* is an integer, or an object implementing
:meth:`~object.__index__`. Zero and negative values of *n* clear
the sequence. Items in the sequence are not copied; they are referenced
multiple times, as explain... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f1ee6a03-c2be-415c-9727-3f6e09386351 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,105 | supabase-export-v2 | fbcabff8f8c6005e | .. method:: str.lstrip(chars=None, /)
Return a copy of the string with leading characters removed. The *chars*
argument is a string specifying the set of characters to be removed. If omitted
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
argument is not a prefix; rather, all combinati... | trusted_official_docs | CPython Docs | .. method:: str.lstrip(chars=None, /)
Return a copy of the string with leading characters removed. The *chars*
argument is a string specifying the set of characters to be removed. If omitted
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
argument is not a prefix; rather, all combinati... | .. method:: str.lstrip(chars=None, /)
Return a copy of the string with leading characters removed. The *chars*
argument is a string specifying the set of characters to be removed. If omitted
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
argument is not a prefix; rather, all combinati... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f212ee60-628c-410c-8e96-d70da0c1411f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,303 | supabase-export-v2 | e758a52416784526 | | ``'f'`` | Floating-point decimal format. | \(3) | +------------+-----------------------------------------------------+-------+ | ``'F'`` | Floating-point decimal format. | \(3) | +------------+-----------------------------------------------------+-------+ | ``'g'`` | Floating-point format.
Uses lowercase exponential ... | trusted_official_docs | CPython Docs | | ``'f'`` | Floating-point decimal format. | \(3) | +------------+-----------------------------------------------------+-------+ | ``'F'`` | Floating-point decimal format. | \(3) | +------------+-----------------------------------------------------+-------+ | ``'g'`` | Floating-point format.
Uses lowercase exponential ... | | ``'f'`` | Floating-point decimal format. | \(3) | +------------+-----------------------------------------------------+-------+ | ``'F'`` | Floating-point decimal format. | \(3) | +------------+-----------------------------------------------------+-------+ | ``'g'`` | Floating-point format.
Uses lowercase exponential ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f22a500d-230e-4b44-9632-1d03006693d4 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,504 | supabase-export-v2 | 1661a5b7cd72ac85 | or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a suffix; rather, all combinations of its values are stripped::
>>> b' spacious '.rstrip()
b' spacious'
>>> b'mississippi'.rstrip(b'ipz')
b'mississ' | trusted_official_docs | CPython Docs | or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a suffix; rather, all combinations of its values are stripped::
>>> b' spacious '.rstrip()
b' spacious'
>>> b'mississippi'.rstrip(b'ipz')
b'mississ' | or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a suffix; rather, all combinations of its values are stripped::
>>> b' spacious '.rstrip()
b' spacious'
>>> b'mississippi'.rstrip(b'ipz')
b'mississ' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f2d665de-b5ab-46ff-977f-cd5870e7d63a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,666 | supabase-export-v2 | 0accadcb9eec858d | can be indexed with tuples of exactly *ndim* integers where *ndim* is the number of dimensions. Zero-dimensional memoryviews can be indexed with the empty tuple.
Here is an example with a non-byte format:: | trusted_official_docs | CPython Docs | can be indexed with tuples of exactly *ndim* integers where *ndim* is the number of dimensions. Zero-dimensional memoryviews can be indexed with the empty tuple.
Here is an example with a non-byte format:: | can be indexed with tuples of exactly *ndim* integers where *ndim* is the number of dimensions. Zero-dimensional memoryviews can be indexed with the empty tuple.
Here is an example with a non-byte format:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f3177cf7-d9d3-478d-87d9-a017eda1a90c | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,828 | supabase-export-v2 | a57109b7319e9166 | equal and the two sequences must be of the same type and have the same length. (For full details see :ref:`comparisons` in the language reference.)
.. index::
single: loop; over mutable sequence
single: mutable sequence; loop over | trusted_official_docs | CPython Docs | equal and the two sequences must be of the same type and have the same length. (For full details see :ref:`comparisons` in the language reference.)
.. index::
single: loop; over mutable sequence
single: mutable sequence; loop over | equal and the two sequences must be of the same type and have the same length. (For full details see :ref:`comparisons` in the language reference.)
.. index::
single: loop; over mutable sequence
single: mutable sequence; loop over | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f3847a34-fdca-4693-bbeb-4563003ee0fc | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,269 | supabase-export-v2 | 7a52b9aa4f609629 | These strings follow the same syntax and evaluation rules as :ref:`formatted string literals <stdtypes-fstrings>`, with for the following differences:
* Rather than evaluating to a ``str`` object, template string literals evaluate
to a :class:`string.templatelib.Template` object. | trusted_official_docs | CPython Docs | These strings follow the same syntax and evaluation rules as :ref:`formatted string literals <stdtypes-fstrings>`, with for the following differences:
* Rather than evaluating to a ``str`` object, template string literals evaluate
to a :class:`string.templatelib.Template` object. | These strings follow the same syntax and evaluation rules as :ref:`formatted string literals <stdtypes-fstrings>`, with for the following differences:
* Rather than evaluating to a ``str`` object, template string literals evaluate
to a :class:`string.templatelib.Template` object. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f4356862-9137-42eb-af22-15ccde186646 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,247 | supabase-export-v2 | 9ffc5eefaac005e8 | field expression, the resulting f-string will contain the expression's source, the equal sign, and the value of the expression. This is often useful for debugging::
>>> number = 14.3
>>> f'{number=}'
'number=14.3' | trusted_official_docs | CPython Docs | field expression, the resulting f-string will contain the expression's source, the equal sign, and the value of the expression. This is often useful for debugging::
>>> number = 14.3
>>> f'{number=}'
'number=14.3' | field expression, the resulting f-string will contain the expression's source, the equal sign, and the value of the expression. This is often useful for debugging::
>>> number = 14.3
>>> f'{number=}'
'number=14.3' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f43fb8c3-b19c-4515-a04c-670de1ae90bc | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,072 | supabase-export-v2 | cda110f2258e6376 | "non-printable" means that :func:`repr` on built-in types will hex-escape the character. It has no bearing on the handling of strings written to :data:`sys.stdout` or :data:`sys.stderr`.
The printable characters are those which in the Unicode character database
(see :mod:`unicodedata`) have a general category in group... | trusted_official_docs | CPython Docs | "non-printable" means that :func:`repr` on built-in types will hex-escape the character. It has no bearing on the handling of strings written to :data:`sys.stdout` or :data:`sys.stderr`.
The printable characters are those which in the Unicode character database
(see :mod:`unicodedata`) have a general category in group... | "non-printable" means that :func:`repr` on built-in types will hex-escape the character. It has no bearing on the handling of strings written to :data:`sys.stdout` or :data:`sys.stderr`.
The printable characters are those which in the Unicode character database
(see :mod:`unicodedata`) have a general category in group... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f47013e2-07a6-4942-baa2-909ea06d27ca | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,107 | supabase-export-v2 | 05dc325cb3f6c9f4 | >>> ' spacious '.lstrip() 'spacious ' >>> 'www.example.com'.lstrip('cmowz.') 'example.com'
See :meth:`str.removeprefix` for a method that will remove a single prefix
string rather than all of a set of characters. For example:: | trusted_official_docs | CPython Docs | >>> ' spacious '.lstrip() 'spacious ' >>> 'www.example.com'.lstrip('cmowz.') 'example.com'
See :meth:`str.removeprefix` for a method that will remove a single prefix
string rather than all of a set of characters. For example:: | >>> ' spacious '.lstrip() 'spacious ' >>> 'www.example.com'.lstrip('cmowz.') 'example.com'
See :meth:`str.removeprefix` for a method that will remove a single prefix
string rather than all of a set of characters. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f586e35e-fa37-4cbc-a97a-4cfb9dff7f36 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,645 | supabase-export-v2 | 7f247a2e55e0ddc6 | index:: single: __eq__() (instance method) single: __ne__() (instance method) single: __lt__() (instance method) single: __le__() (instance method) single: __gt__() (instance method) single: __ge__() (instance method)
Non-identical instances of a class normally compare as non-equal unless the
class defines the :meth:`~... | trusted_official_docs | CPython Docs | index:: single: __eq__() (instance method) single: __ne__() (instance method) single: __lt__() (instance method) single: __le__() (instance method) single: __gt__() (instance method) single: __ge__() (instance method)
Non-identical instances of a class normally compare as non-equal unless the
class defines the :meth:`~... | index:: single: __eq__() (instance method) single: __ne__() (instance method) single: __lt__() (instance method) single: __le__() (instance method) single: __gt__() (instance method) single: __ge__() (instance method)
Non-identical instances of a class normally compare as non-equal unless the
class defines the :meth:`~... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f7220acb-8401-457d-869b-3c5520b45ad7 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,947 | supabase-export-v2 | a733ee6aca062530 | compare equal might have different :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` attributes, for example ``range(0) == range(2, 1, 3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)
.. versionchanged:: 3.2
Implement the Sequence ABC. Support slicing and negative indices. Test :class:`int` objects for m... | trusted_official_docs | CPython Docs | compare equal might have different :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` attributes, for example ``range(0) == range(2, 1, 3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)
.. versionchanged:: 3.2
Implement the Sequence ABC. Support slicing and negative indices. Test :class:`int` objects for m... | compare equal might have different :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` attributes, for example ``range(0) == range(2, 1, 3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)
.. versionchanged:: 3.2
Implement the Sequence ABC. Support slicing and negative indices. Test :class:`int` objects for m... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f741a086-b26f-44a6-a529-8ed8658908c2 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,005 | supabase-export-v2 | fec120d9cc7e7f88 | of *errors* is not checked for validity unless an encoding error actually occurs, :ref:`devmode` is enabled or a :ref:`debug build <debug-build>` is used. For example::
>>> encoded_str_to_bytes = 'Python'.encode()
>>> type(encoded_str_to_bytes)
<class 'bytes'>
>>> encoded_str_to_bytes
b'Python' | trusted_official_docs | CPython Docs | of *errors* is not checked for validity unless an encoding error actually occurs, :ref:`devmode` is enabled or a :ref:`debug build <debug-build>` is used. For example::
>>> encoded_str_to_bytes = 'Python'.encode()
>>> type(encoded_str_to_bytes)
<class 'bytes'>
>>> encoded_str_to_bytes
b'Python' | of *errors* is not checked for validity unless an encoding error actually occurs, :ref:`devmode` is enabled or a :ref:`debug build <debug-build>` is used. For example::
>>> encoded_str_to_bytes = 'Python'.encode()
>>> type(encoded_str_to_bytes)
<class 'bytes'>
>>> encoded_str_to_bytes
b'Python' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f7d069c1-e76a-4c4f-ab5d-6d5d3a86e31d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,678 | supabase-export-v2 | 8ee570e051bd4332 | .. method:: __eq__(exporter)
A memoryview and a :pep:`3118` exporter are equal if their shapes are
equivalent and if all corresponding values are equal when the operands'
respective format codes are interpreted using :mod:`struct` syntax. | trusted_official_docs | CPython Docs | .. method:: __eq__(exporter)
A memoryview and a :pep:`3118` exporter are equal if their shapes are
equivalent and if all corresponding values are equal when the operands'
respective format codes are interpreted using :mod:`struct` syntax. | .. method:: __eq__(exporter)
A memoryview and a :pep:`3118` exporter are equal if their shapes are
equivalent and if all corresponding values are equal when the operands'
respective format codes are interpreted using :mod:`struct` syntax. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f83a5123-b3e6-4883-9ca7-2ebc2818d762 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,753 | supabase-export-v2 | 599373f5b125a22f | .. method:: float.hex()
Return a representation of a floating-point number as a hexadecimal
string. For finite floating-point numbers, this representation
will always include a leading ``0x`` and a trailing ``p`` and
exponent. | trusted_official_docs | CPython Docs | .. method:: float.hex()
Return a representation of a floating-point number as a hexadecimal
string. For finite floating-point numbers, this representation
will always include a leading ``0x`` and a trailing ``p`` and
exponent. | .. method:: float.hex()
Return a representation of a floating-point number as a hexadecimal
string. For finite floating-point numbers, this representation
will always include a leading ``0x`` and a trailing ``p`` and
exponent. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f853197c-ba7d-4c3b-b5d6-1ef1579ad96e | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,330 | supabase-export-v2 | f82a63945f4a6ed2 | * Single quotes: ``b'still allows embedded "double" quotes'`` * Double quotes: ``b"still allows embedded 'single' quotes"`` * Triple quoted: ``b'''3 single quotes'''``, ``b"""3 double quotes"""``
Only ASCII characters are permitted in bytes literals (regardless of the
declared source code encoding). Any binary values ... | trusted_official_docs | CPython Docs | * Single quotes: ``b'still allows embedded "double" quotes'`` * Double quotes: ``b"still allows embedded 'single' quotes"`` * Triple quoted: ``b'''3 single quotes'''``, ``b"""3 double quotes"""``
Only ASCII characters are permitted in bytes literals (regardless of the
declared source code encoding). Any binary values ... | * Single quotes: ``b'still allows embedded "double" quotes'`` * Double quotes: ``b"still allows embedded 'single' quotes"`` * Triple quoted: ``b'''3 single quotes'''``, ``b"""3 double quotes"""``
Only ASCII characters are permitted in bytes literals (regardless of the
declared source code encoding). Any binary values ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f8b467f4-b8eb-4913-9cc6-5fbc54161285 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,701 | supabase-export-v2 | 859af6087a0e9d8d | Return a readonly version of the memoryview object. The original memoryview object is unchanged. ::
>>> m = memoryview(bytearray(b'abc'))
>>> mm = m.toreadonly()
>>> mm.tolist()
[97, 98, 99]
>>> mm[0] = 42
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cannot modify read-only m... | trusted_official_docs | CPython Docs | Return a readonly version of the memoryview object. The original memoryview object is unchanged. ::
>>> m = memoryview(bytearray(b'abc'))
>>> mm = m.toreadonly()
>>> mm.tolist()
[97, 98, 99]
>>> mm[0] = 42
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cannot modify read-only m... | Return a readonly version of the memoryview object. The original memoryview object is unchanged. ::
>>> m = memoryview(bytearray(b'abc'))
>>> mm = m.toreadonly()
>>> mm.tolist()
[97, 98, 99]
>>> mm[0] = 42
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cannot modify read-only m... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f9bc0986-eb89-41d7-a8c8-7546e8f2aa6d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,786 | supabase-export-v2 | 305b2a4434b24483 | P) * pow(n, P - 2, P) % P if m < 0: hash_value = -hash_value if hash_value == -1: hash_value = -2 return hash_value
def hash_float(x):
"""Compute the hash of a float x.""" | trusted_official_docs | CPython Docs | P) * pow(n, P - 2, P) % P if m < 0: hash_value = -hash_value if hash_value == -1: hash_value = -2 return hash_value
def hash_float(x):
"""Compute the hash of a float x.""" | P) * pow(n, P - 2, P) % P if m < 0: hash_value = -hash_value if hash_value == -1: hash_value = -2 return hash_value
def hash_float(x):
"""Compute the hash of a float x.""" | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f9f7f8f3-cfe6-4680-9e36-2bbe10aa23e3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,689 | supabase-export-v2 | d7c5a3fdacb3cc17 | This table lists the bitwise operations sorted in ascending priority:
+------------+--------------------------------+----------+
| Operation | Result | Notes |
+============+================================+==========+
| ``x | y`` | bitwise :dfn:`or` of *x* and | \(4) |
| | *y* | |
+------------+-----------------------... | trusted_official_docs | CPython Docs | This table lists the bitwise operations sorted in ascending priority:
+------------+--------------------------------+----------+
| Operation | Result | Notes |
+============+================================+==========+
| ``x | y`` | bitwise :dfn:`or` of *x* and | \(4) |
| | *y* | |
+------------+-----------------------... | This table lists the bitwise operations sorted in ascending priority:
+------------+--------------------------------+----------+
| Operation | Result | Notes |
+============+================================+==========+
| ``x | y`` | bitwise :dfn:`or` of *x* and | \(4) |
| | *y* | |
+------------+-----------------------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f9f919be-95ba-48c9-ae90-0723517614c3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,298 | supabase-export-v2 | b86d544bdc83e66e | for numeric values. | +---------+---------------------------------------------------------------------+ | ``'-'`` | The converted value is left adjusted (overrides the ``'0'`` | | | conversion if both are given).
|
+---------+---------------------------------------------------------------------+
| ``' '`` | (a space) A... | trusted_official_docs | CPython Docs | for numeric values. | +---------+---------------------------------------------------------------------+ | ``'-'`` | The converted value is left adjusted (overrides the ``'0'`` | | | conversion if both are given).
|
+---------+---------------------------------------------------------------------+
| ``' '`` | (a space) A... | for numeric values. | +---------+---------------------------------------------------------------------+ | ``'-'`` | The converted value is left adjusted (overrides the ``'0'`` | | | conversion if both are given).
|
+---------+---------------------------------------------------------------------+
| ``' '`` | (a space) A... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fa18b193-4eb8-4c97-a3d6-593d3e0d0d1c | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,491 | supabase-export-v2 | b20401163c9ae0b4 | or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a prefix; rather, all combinations of its values are stripped::
>>> b' spacious '.lstrip()
b'spacious '
>>> b'www.example.com'.lstrip(b'cmowz.')
b'example.com' | trusted_official_docs | CPython Docs | or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a prefix; rather, all combinations of its values are stripped::
>>> b' spacious '.lstrip()
b'spacious '
>>> b'www.example.com'.lstrip(b'cmowz.')
b'example.com' | or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a prefix; rather, all combinations of its values are stripped::
>>> b' spacious '.lstrip()
b'spacious '
>>> b'www.example.com'.lstrip(b'cmowz.')
b'example.com' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fa252f57-4419-4565-ba6f-8825f708747b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,642 | supabase-export-v2 | 175daddb5c9693b6 | | +------------+-------------------------+ | ``!=`` | not equal | +------------+-------------------------+ | ``is`` | object identity | +------------+-------------------------+ | ``is not`` | negated object identity | +------------+-------------------------+
.. index::
pair: object; numeric
pair: objects; comparing | trusted_official_docs | CPython Docs | | +------------+-------------------------+ | ``!=`` | not equal | +------------+-------------------------+ | ``is`` | object identity | +------------+-------------------------+ | ``is not`` | negated object identity | +------------+-------------------------+
.. index::
pair: object; numeric
pair: objects; comparing | | +------------+-------------------------+ | ``!=`` | not equal | +------------+-------------------------+ | ``is`` | object identity | +------------+-------------------------+ | ``is not`` | negated object identity | +------------+-------------------------+
.. index::
pair: object; numeric
pair: objects; comparing | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fa7f136c-c2f5-400c-a90e-24b17da94458 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,163 | supabase-export-v2 | 2d543350e3ae67dc | >>> ' spacious '.rstrip() ' spacious' >>> 'mississippi'.rstrip('ipz') 'mississ'
See :meth:`removesuffix` for a method that will remove a single suffix
string rather than all of a set of characters. For example:: | trusted_official_docs | CPython Docs | >>> ' spacious '.rstrip() ' spacious' >>> 'mississippi'.rstrip('ipz') 'mississ'
See :meth:`removesuffix` for a method that will remove a single suffix
string rather than all of a set of characters. For example:: | >>> ' spacious '.rstrip() ' spacious' >>> 'mississippi'.rstrip('ipz') 'mississ'
See :meth:`removesuffix` for a method that will remove a single suffix
string rather than all of a set of characters. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fd3319d6-dd0b-4a25-9380-ac1ea1e600b2 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,802 | supabase-export-v2 | 9d681c43793fb8c6 | using two distinct methods; these are used to allow user-defined classes to support iteration. Sequences, described below in more detail, always support the iteration methods.
One method needs to be defined for container objects to provide :term:`iterable`
support: | trusted_official_docs | CPython Docs | using two distinct methods; these are used to allow user-defined classes to support iteration. Sequences, described below in more detail, always support the iteration methods.
One method needs to be defined for container objects to provide :term:`iterable`
support: | using two distinct methods; these are used to allow user-defined classes to support iteration. Sequences, described below in more detail, always support the iteration methods.
One method needs to be defined for container objects to provide :term:`iterable`
support: | 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.