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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
93cfec8a-0a6d-43d2-baeb-f41b4e73592b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,906 | supabase-export-v2 | 3ddb7bb9bc3878bd | suppressed - if any comparison operations fail, the entire sort operation will fail (and the list will likely be left in a partially modified state).
:meth:`sort` accepts two arguments that can only be passed by keyword
(:ref:`keyword-only arguments <keyword-only_parameter>`): | trusted_official_docs | CPython Docs | suppressed - if any comparison operations fail, the entire sort operation will fail (and the list will likely be left in a partially modified state).
:meth:`sort` accepts two arguments that can only be passed by keyword
(:ref:`keyword-only arguments <keyword-only_parameter>`): | suppressed - if any comparison operations fail, the entire sort operation will fail (and the list will likely be left in a partially modified state).
:meth:`sort` accepts two arguments that can only be passed by keyword
(:ref:`keyword-only arguments <keyword-only_parameter>`): | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
93fa502e-d4b9-4160-988d-dc29a783064a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,768 | supabase-export-v2 | 02a6fb694dd2e577 | Class method to convert a number to a complex number.
For a general Python object ``x``, ``complex.from_number(x)`` delegates to
``x.__complex__()``. If :meth:`~object.__complex__` is not defined then it falls back
to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls back
to :meth:`~objec... | trusted_official_docs | CPython Docs | Class method to convert a number to a complex number.
For a general Python object ``x``, ``complex.from_number(x)`` delegates to
``x.__complex__()``. If :meth:`~object.__complex__` is not defined then it falls back
to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls back
to :meth:`~objec... | Class method to convert a number to a complex number.
For a general Python object ``x``, ``complex.from_number(x)`` delegates to
``x.__complex__()``. If :meth:`~object.__complex__` is not defined then it falls back
to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls back
to :meth:`~objec... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
93ff65e0-ed79-4201-8c40-bea731fc6bbb | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,618 | supabase-export-v2 | 8094521210e4b6a5 | must be a tuple with exactly the number of items specified by the format bytes object, or a single mapping object (for example, a dictionary).
.. index::
single: () (parentheses); in printf-style formatting
single: * (asterisk); in printf-style formatting
single: . (dot); in printf-style formatting | trusted_official_docs | CPython Docs | must be a tuple with exactly the number of items specified by the format bytes object, or a single mapping object (for example, a dictionary).
.. index::
single: () (parentheses); in printf-style formatting
single: * (asterisk); in printf-style formatting
single: . (dot); in printf-style formatting | must be a tuple with exactly the number of items specified by the format bytes object, or a single mapping object (for example, a dictionary).
.. index::
single: () (parentheses); in printf-style formatting
single: * (asterisk); in printf-style formatting
single: . (dot); in printf-style formatting | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
948e54fa-a512-45d2-8ae6-d005ebcb96b3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,640 | supabase-export-v2 | 875423712d928ca1 | be used for Python2/3 code bases. | | +------------+-----------------------------------------------------+-------+ | ``'a'`` | Bytes (converts any Python object using | \(5) | | | ``repr(obj).encode('ascii', 'backslashreplace')``).
| |
+------------+-----------------------------------------------------+-------+
| ``'r'... | trusted_official_docs | CPython Docs | be used for Python2/3 code bases. | | +------------+-----------------------------------------------------+-------+ | ``'a'`` | Bytes (converts any Python object using | \(5) | | | ``repr(obj).encode('ascii', 'backslashreplace')``).
| |
+------------+-----------------------------------------------------+-------+
| ``'r'... | be used for Python2/3 code bases. | | +------------+-----------------------------------------------------+-------+ | ``'a'`` | Bytes (converts any Python object using | \(5) | | | ``repr(obj).encode('ascii', 'backslashreplace')``).
| |
+------------+-----------------------------------------------------+-------+
| ``'r'... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
94910066-5dff-4697-94fe-fb0133cb99fa | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,481 | supabase-export-v2 | d9878eb6e2b78756 | data by passing appropriate arguments. Note that all of the bytearray methods in this section do *not* operate in place, and instead produce new objects.
.. method:: bytes.center(width, fillbyte=b' ', /)
bytearray.center(width, fillbyte=b' ', /) | trusted_official_docs | CPython Docs | data by passing appropriate arguments. Note that all of the bytearray methods in this section do *not* operate in place, and instead produce new objects.
.. method:: bytes.center(width, fillbyte=b' ', /)
bytearray.center(width, fillbyte=b' ', /) | data by passing appropriate arguments. Note that all of the bytearray methods in this section do *not* operate in place, and instead produce new objects.
.. method:: bytes.center(width, fillbyte=b' ', /)
bytearray.center(width, fillbyte=b' ', /) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
94a39b85-0282-4fb1-9e70-3e9d7b9625c3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,839 | supabase-export-v2 | 0f33b4f083093971 | 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``.
(4)
The slice of *s* from *i* to *j* is defined as the sequence of items with
index *k* such that ``i <= k < j``. | trusted_official_docs | CPython Docs | 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``.
(4)
The slice of *s* from *i* to *j* is defined as the sequence of items with
index *k* such that ``i <= k < j``. | 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``.
(4)
The slice of *s* from *i* to *j* is defined as the sequence of items with
index *k* such that ``i <= k < j``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
94ff4974-cc21-4336-89b0-b1e6adc862a9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,694 | supabase-export-v2 | 39642a0fe4df1c2a | (3) A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``.
(4)
Performing these calculations with at least one extra sign extension bit in
a finite two's complement representation (a working bit-width of
``1 + max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the
same result a... | trusted_official_docs | CPython Docs | (3) A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``.
(4)
Performing these calculations with at least one extra sign extension bit in
a finite two's complement representation (a working bit-width of
``1 + max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the
same result a... | (3) A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``.
(4)
Performing these calculations with at least one extra sign extension bit in
a finite two's complement representation (a working bit-width of
``1 + max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the
same result a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
95f49eda-696a-472e-8199-dbaba3fcc3f1 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,216 | supabase-export-v2 | 670e5edb39233110 | >>> 'Hello world'.title() 'Hello World'
The algorithm uses a simple language-independent definition of a word as
groups of consecutive letters. The definition works in many contexts but
it means that apostrophes in contractions and possessives form word
boundaries, which may not be the desired result:: | trusted_official_docs | CPython Docs | >>> 'Hello world'.title() 'Hello World'
The algorithm uses a simple language-independent definition of a word as
groups of consecutive letters. The definition works in many contexts but
it means that apostrophes in contractions and possessives form word
boundaries, which may not be the desired result:: | >>> 'Hello world'.title() 'Hello World'
The algorithm uses a simple language-independent definition of a word as
groups of consecutive letters. The definition works in many contexts but
it means that apostrophes in contractions and possessives form word
boundaries, which may not be the desired result:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
97a82318-c79e-436c-82fb-b548a0d29078 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,145 | supabase-export-v2 | 7a471f367297d32f | .. doctest::
>>> 'spam, spam, 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 | trusted_official_docs | CPython Docs | .. doctest::
>>> 'spam, spam, 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 | .. doctest::
>>> 'spam, spam, 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 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9832980f-5744-4540-853c-d5b5967d83e6 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,230 | supabase-export-v2 | 47033ebeacad43e6 | .. method:: str.upper()
Return a copy of the string with all the cased characters [4]_ converted to
uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s``
contains uncased characters or if the Unicode category of the resulting
character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter,
ti... | trusted_official_docs | CPython Docs | .. method:: str.upper()
Return a copy of the string with all the cased characters [4]_ converted to
uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s``
contains uncased characters or if the Unicode category of the resulting
character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter,
ti... | .. method:: str.upper()
Return a copy of the string with all the cased characters [4]_ converted to
uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s``
contains uncased characters or if the Unicode category of the resulting
character(s) is not "Lu" (Letter, uppercase), but e.g. "Lt" (Letter,
ti... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
98616339-d622-45f5-a83a-96f12af006b0 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,071 | supabase-export-v2 | 19e8b42984a8728c | Return ``True`` if all characters in the string are printable, ``False`` if it contains at least one non-printable character.
Here "printable" means the character is suitable for :func:`repr` to use in
its output; "non-printable" means that :func:`repr` on built-in types will
hex-escape the character. It has no beari... | trusted_official_docs | CPython Docs | Return ``True`` if all characters in the string are printable, ``False`` if it contains at least one non-printable character.
Here "printable" means the character is suitable for :func:`repr` to use in
its output; "non-printable" means that :func:`repr` on built-in types will
hex-escape the character. It has no beari... | Return ``True`` if all characters in the string are printable, ``False`` if it contains at least one non-printable character.
Here "printable" means the character is suitable for :func:`repr` to use in
its output; "non-printable" means that :func:`repr` on built-in types will
hex-escape the character. It has no beari... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
98d6acf6-3117-40c5-a788-72a883354edf | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,714 | supabase-export-v2 | 410465ee0c34fb42 | >>> x.itemsize 8 >>> len(x) 3 >>> x.nbytes 24 >>> y = x.cast('B') >>> y.format 'B' >>> y.itemsize 1 >>> len(y) 24 >>> y.nbytes 24
Cast 1D/unsigned bytes to 1D/char:: | trusted_official_docs | CPython Docs | >>> x.itemsize 8 >>> len(x) 3 >>> x.nbytes 24 >>> y = x.cast('B') >>> y.format 'B' >>> y.itemsize 1 >>> len(y) 24 >>> y.nbytes 24
Cast 1D/unsigned bytes to 1D/char:: | >>> x.itemsize 8 >>> len(x) 3 >>> x.nbytes 24 >>> y = x.cast('B') >>> y.format 'B' >>> y.itemsize 1 >>> len(y) 24 >>> y.nbytes 24
Cast 1D/unsigned bytes to 1D/char:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
99895b73-c165-46fe-944a-a1cf1d572d37 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,535 | supabase-export-v2 | c33bfb0b81946c61 | .. method:: bytes.isalnum() bytearray.isalnum()
Return ``True`` if all bytes in the sequence are alphabetical ASCII characters
or ASCII decimal digits and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those byte values in the sequence
``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS... | trusted_official_docs | CPython Docs | .. method:: bytes.isalnum() bytearray.isalnum()
Return ``True`` if all bytes in the sequence are alphabetical ASCII characters
or ASCII decimal digits and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those byte values in the sequence
``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS... | .. method:: bytes.isalnum() bytearray.isalnum()
Return ``True`` if all bytes in the sequence are alphabetical ASCII characters
or ASCII decimal digits and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those byte values in the sequence
``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
999a3749-acaf-4000-9900-f0f91a8ca2bc | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,847 | supabase-export-v2 | bbea5cfc17a9bbab | * for other types, investigate the relevant class documentation
(7)
Some sequence types (such as :class:`range`) only support item sequences
that follow specific patterns, and hence don't support sequence
concatenation or repetition. | trusted_official_docs | CPython Docs | * for other types, investigate the relevant class documentation
(7)
Some sequence types (such as :class:`range`) only support item sequences
that follow specific patterns, and hence don't support sequence
concatenation or repetition. | * for other types, investigate the relevant class documentation
(7)
Some sequence types (such as :class:`range`) only support item sequences
that follow specific patterns, and hence don't support sequence
concatenation or repetition. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9ab88eff-a0a7-41d6-897f-50e0f6e80ce9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,638 | supabase-export-v2 | 47252f169995e1f5 | | ``'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 | |
9b72012d-7703-4ec2-ab21-8d3ce0f0be3a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,025 | supabase-export-v2 | 662ccb6e5b4aa607 | .. doctest::
>>> "The sum of 1 + 2 is {0}".format(1+2)
'The sum of 1 + 2 is 3'
>>> "The sum of {a} + {b} is {answer}".format(answer=1+2, a=1, b=2)
'The sum of 1 + 2 is 3'
>>> "{1} expects the {0} Inquisition!".format("Spanish", "Nobody")
'Nobody expects the Spanish Inquisition!' | trusted_official_docs | CPython Docs | .. doctest::
>>> "The sum of 1 + 2 is {0}".format(1+2)
'The sum of 1 + 2 is 3'
>>> "The sum of {a} + {b} is {answer}".format(answer=1+2, a=1, b=2)
'The sum of 1 + 2 is 3'
>>> "{1} expects the {0} Inquisition!".format("Spanish", "Nobody")
'Nobody expects the Spanish Inquisition!' | .. doctest::
>>> "The sum of 1 + 2 is {0}".format(1+2)
'The sum of 1 + 2 is 3'
>>> "The sum of {a} + {b} is {answer}".format(answer=1+2, a=1, b=2)
'The sum of 1 + 2 is 3'
>>> "{1} expects the {0} Inquisition!".format("Spanish", "Nobody")
'Nobody expects the Spanish Inquisition!' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9b76cbb8-194d-4e1f-b1d6-d767919a80f8 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,626 | supabase-export-v2 | 8c2641cfb48177cd | .. index:: pair: operator; or pair: operator; and single: False single: True
Operations and built-in functions that have a Boolean result always return ``0``
or ``False`` for false and ``1`` or ``True`` for true, unless otherwise stated. (Important exception: the Boolean operations ``or`` and ``and`` always return
one ... | trusted_official_docs | CPython Docs | .. index:: pair: operator; or pair: operator; and single: False single: True
Operations and built-in functions that have a Boolean result always return ``0``
or ``False`` for false and ``1`` or ``True`` for true, unless otherwise stated. (Important exception: the Boolean operations ``or`` and ``and`` always return
one ... | .. index:: pair: operator; or pair: operator; and single: False single: True
Operations and built-in functions that have a Boolean result always return ``0``
or ``False`` for false and ``1`` or ``True`` for true, unless otherwise stated. (Important exception: the Boolean operations ``or`` and ``and`` always return
one ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9b822df8-c3db-495e-9753-f778ad8d93ec | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,010 | supabase-export-v2 | 4879e0237d2eec52 | optional *start*, test beginning at that position. With optional *end*, stop comparing at that position. Using *start* and *end* is equivalent to ``str[start:end].endswith(suffix)``. For example::
>>> 'Python'.endswith('on')
True
>>> 'a tuple of suffixes'.endswith(('at', 'in'))
False
>>> 'a tuple of suffixes'.endsw... | trusted_official_docs | CPython Docs | optional *start*, test beginning at that position. With optional *end*, stop comparing at that position. Using *start* and *end* is equivalent to ``str[start:end].endswith(suffix)``. For example::
>>> 'Python'.endswith('on')
True
>>> 'a tuple of suffixes'.endswith(('at', 'in'))
False
>>> 'a tuple of suffixes'.endsw... | optional *start*, test beginning at that position. With optional *end*, stop comparing at that position. Using *start* and *end* is equivalent to ``str[start:end].endswith(suffix)``. For example::
>>> 'Python'.endswith('on')
True
>>> 'a tuple of suffixes'.endswith(('at', 'in'))
False
>>> 'a tuple of suffixes'.endsw... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9c1267f4-3987-4caf-a5bf-a0ecde71271b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,680 | supabase-export-v2 | c4879c247fa132db | *x* rounded to *n* digits, | | n]) <round>` | rounding half to even. If *n* is | | | omitted, it defaults to 0.
|
+--------------------+---------------------------------------------+
| :func:`math.floor(\| the greatest :class:`~numbers.Integral` |
| x) <math.floor>` | <= *x* |
+--------------------+--------------------... | trusted_official_docs | CPython Docs | *x* rounded to *n* digits, | | n]) <round>` | rounding half to even. If *n* is | | | omitted, it defaults to 0.
|
+--------------------+---------------------------------------------+
| :func:`math.floor(\| the greatest :class:`~numbers.Integral` |
| x) <math.floor>` | <= *x* |
+--------------------+--------------------... | *x* rounded to *n* digits, | | n]) <round>` | rounding half to even. If *n* is | | | omitted, it defaults to 0.
|
+--------------------+---------------------------------------------+
| :func:`math.floor(\| the greatest :class:`~numbers.Integral` |
| x) <math.floor>` | <= *x* |
+--------------------+--------------------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9c2a385e-cc5a-4663-b0f5-459bc7314964 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,502 | supabase-export-v2 | 2177886462ffffd2 | subsequence consisting solely of ASCII whitespace is a separator. Except for splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is described in detail below.
.. method:: bytes.rstrip(bytes=None, /)
bytearray.rstrip(bytes=None, /) | trusted_official_docs | CPython Docs | subsequence consisting solely of ASCII whitespace is a separator. Except for splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is described in detail below.
.. method:: bytes.rstrip(bytes=None, /)
bytearray.rstrip(bytes=None, /) | subsequence consisting solely of ASCII whitespace is a separator. Except for splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is described in detail below.
.. method:: bytes.rstrip(bytes=None, /)
bytearray.rstrip(bytes=None, /) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9c5081e5-3cef-42fe-bc17-1e23d7acc872 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,863 | supabase-export-v2 | 6feedbf8692d7fb7 | This support allows immutable sequences, such as :class:`tuple` instances, to be used as :class:`dict` keys and stored in :class:`set` and :class:`frozenset` instances.
Attempting to hash an immutable sequence that contains unhashable values will
result in :exc:`TypeError`. | trusted_official_docs | CPython Docs | This support allows immutable sequences, such as :class:`tuple` instances, to be used as :class:`dict` keys and stored in :class:`set` and :class:`frozenset` instances.
Attempting to hash an immutable sequence that contains unhashable values will
result in :exc:`TypeError`. | This support allows immutable sequences, such as :class:`tuple` instances, to be used as :class:`dict` keys and stored in :class:`set` and :class:`frozenset` instances.
Attempting to hash an immutable sequence that contains unhashable values will
result in :exc:`TypeError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9c7fc926-fc4e-43bf-9405-f5dade4cb594 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,665 | supabase-export-v2 | 65f91047c311cb11 | All numeric types (except complex) support the following operations (for priorities of the operations, see :ref:`operator-summary`):
+---------------------+---------------------------------+---------+--------------------+
| Operation | Result | Notes | Full documentation |
+=====================+=======================... | trusted_official_docs | CPython Docs | All numeric types (except complex) support the following operations (for priorities of the operations, see :ref:`operator-summary`):
+---------------------+---------------------------------+---------+--------------------+
| Operation | Result | Notes | Full documentation |
+=====================+=======================... | All numeric types (except complex) support the following operations (for priorities of the operations, see :ref:`operator-summary`):
+---------------------+---------------------------------+---------+--------------------+
| Operation | Result | Notes | Full documentation |
+=====================+=======================... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9d5c8b45-f66b-4464-95d0-c43eefec2c9a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,777 | supabase-export-v2 | 14db971cd458e44c | not) then ``n`` has no inverse modulo ``P`` and the rule above doesn't apply; in this case define ``hash(x)`` to be the constant value ``sys.hash_info.inf``.
- If ``x = m / n`` is a negative rational number define ``hash(x)``
as ``-hash(-x)``. If the resulting hash is ``-1``, replace it with
``-2``. | trusted_official_docs | CPython Docs | not) then ``n`` has no inverse modulo ``P`` and the rule above doesn't apply; in this case define ``hash(x)`` to be the constant value ``sys.hash_info.inf``.
- If ``x = m / n`` is a negative rational number define ``hash(x)``
as ``-hash(-x)``. If the resulting hash is ``-1``, replace it with
``-2``. | not) then ``n`` has no inverse modulo ``P`` and the rule above doesn't apply; in this case define ``hash(x)`` to be the constant value ``sys.hash_info.inf``.
- If ``x = m / n`` is a negative rational number define ``hash(x)``
as ``-hash(-x)``. If the resulting hash is ``-1``, replace it with
``-2``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9da61722-f2e2-4c51-9136-95b13f3986f3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,780 | supabase-export-v2 | 5bea734e6a857086 | hash(z.imag)``, reduced modulo ``2**sys.hash_info.width`` so that it lies in ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))``. Again, if the result is ``-1``, it's replaced with ``-2``.
To clarify the above rules, here's some example Python code,
equivalent to the built-in hash, for computing the ... | trusted_official_docs | CPython Docs | hash(z.imag)``, reduced modulo ``2**sys.hash_info.width`` so that it lies in ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))``. Again, if the result is ``-1``, it's replaced with ``-2``.
To clarify the above rules, here's some example Python code,
equivalent to the built-in hash, for computing the ... | hash(z.imag)``, reduced modulo ``2**sys.hash_info.width`` so that it lies in ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))``. Again, if the result is ``-1``, it's replaced with ``-2``.
To clarify the above rules, here's some example Python code,
equivalent to the built-in hash, for computing the ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9e94bfb2-65dd-4fcc-8020-3dc927325b4f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,726 | supabase-export-v2 | 5d884f98363774f5 | The argument *bytes* must either be a :term:`bytes-like object` or an iterable producing bytes.
The *byteorder* argument determines the byte order used to represent the
integer, and defaults to ``"big"``. If *byteorder* is
``"big"``, the most significant byte is at the beginning of the byte
array. If *byteorder* is ... | trusted_official_docs | CPython Docs | The argument *bytes* must either be a :term:`bytes-like object` or an iterable producing bytes.
The *byteorder* argument determines the byte order used to represent the
integer, and defaults to ``"big"``. If *byteorder* is
``"big"``, the most significant byte is at the beginning of the byte
array. If *byteorder* is ... | The argument *bytes* must either be a :term:`bytes-like object` or an iterable producing bytes.
The *byteorder* argument determines the byte order used to represent the
integer, and defaults to ``"big"``. If *byteorder* is
``"big"``, the most significant byte is at the beginning of the byte
array. If *byteorder* is ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9e9dc508-8b40-453c-8074-65571a8e8647 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,681 | supabase-export-v2 | 68c6afacfdbe8234 | the greatest :class:`~numbers.Integral` | | x) <math.floor>` | <= *x* | +--------------------+---------------------------------------------+ | :func:`math.ceil(x)| the least :class:`~numbers.Integral` >= *x* | | <math.ceil>` | | +--------------------+---------------------------------------------+
For additional numeric... | trusted_official_docs | CPython Docs | the greatest :class:`~numbers.Integral` | | x) <math.floor>` | <= *x* | +--------------------+---------------------------------------------+ | :func:`math.ceil(x)| the least :class:`~numbers.Integral` >= *x* | | <math.ceil>` | | +--------------------+---------------------------------------------+
For additional numeric... | the greatest :class:`~numbers.Integral` | | x) <math.floor>` | <= *x* | +--------------------+---------------------------------------------+ | :func:`math.ceil(x)| the least :class:`~numbers.Integral` >= *x* | | <math.ceil>` | | +--------------------+---------------------------------------------+
For additional numeric... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9ec8bb9d-5dcc-4174-97e2-d64dc68da29d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,332 | supabase-export-v2 | 28c6af75f4df7fc5 | use a ``r`` prefix to disable processing of escape sequences. See :ref:`strings` for more about the various forms of bytes literal, including supported escape sequences.
While bytes literals and representations are based on ASCII text, bytes
objects actually behave like immutable sequences of integers, with each
valu... | trusted_official_docs | CPython Docs | use a ``r`` prefix to disable processing of escape sequences. See :ref:`strings` for more about the various forms of bytes literal, including supported escape sequences.
While bytes literals and representations are based on ASCII text, bytes
objects actually behave like immutable sequences of integers, with each
valu... | use a ``r`` prefix to disable processing of escape sequences. See :ref:`strings` for more about the various forms of bytes literal, including supported escape sequences.
While bytes literals and representations are based on ASCII text, bytes
objects actually behave like immutable sequences of integers, with each
valu... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a005146c-1914-4ba7-a159-621af6223148 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,636 | supabase-export-v2 | 4a2350b9ec0e192c | (2) This is a short-circuit operator, so it only evaluates the second argument if the first one is true.
(3)
``not`` has a lower priority than non-Boolean operators, so ``not a == b`` is
interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error. | trusted_official_docs | CPython Docs | (2) This is a short-circuit operator, so it only evaluates the second argument if the first one is true.
(3)
``not`` has a lower priority than non-Boolean operators, so ``not a == b`` is
interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error. | (2) This is a short-circuit operator, so it only evaluates the second argument if the first one is true.
(3)
``not`` has a lower priority than non-Boolean operators, so ``not a == b`` is
interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a02bb31b-4fc9-4628-95d7-fa0af9092a36 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,445 | supabase-export-v2 | c1ed2087d9f9a9ee | The subsequence to search for may be any :term:`bytes-like object` or an integer in the range 0 to 255.
.. versionchanged:: 3.3
Also accept an integer in the range 0 to 255 as the subsequence. | trusted_official_docs | CPython Docs | The subsequence to search for may be any :term:`bytes-like object` or an integer in the range 0 to 255.
.. versionchanged:: 3.3
Also accept an integer in the range 0 to 255 as the subsequence. | The subsequence to search for may be any :term:`bytes-like object` or an integer in the range 0 to 255.
.. versionchanged:: 3.3
Also accept an integer in the range 0 to 255 as the subsequence. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a07bb748-07ba-41e4-b3e1-11e748346512 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,784 | supabase-export-v2 | 71f3a633199ec760 | Assumes m and n are integers, with n positive. Equivalent to hash(fractions.Fraction(m, n)).
"""
P = sys.hash_info.modulus
# Remove common factors of P. (Unnecessary if m and n already coprime.)
while m % P == n % P == 0:
m, n = m // P, n // P | trusted_official_docs | CPython Docs | Assumes m and n are integers, with n positive. Equivalent to hash(fractions.Fraction(m, n)).
"""
P = sys.hash_info.modulus
# Remove common factors of P. (Unnecessary if m and n already coprime.)
while m % P == n % P == 0:
m, n = m // P, n // P | Assumes m and n are integers, with n positive. Equivalent to hash(fractions.Fraction(m, n)).
"""
P = sys.hash_info.modulus
# Remove common factors of P. (Unnecessary if m and n already coprime.)
while m % P == n % P == 0:
m, n = m // P, n // P | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a0841403-d410-42ab-a737-72eceec726d1 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,831 | supabase-export-v2 | bd6ecb5a2efec758 | Notes:
(1)
While the ``in`` and ``not in`` operations are used only for simple
containment testing in the general case, some specialised sequences
(such as :class:`str`, :class:`bytes` and :class:`bytearray`) also use
them for subsequence testing:: | trusted_official_docs | CPython Docs | Notes:
(1)
While the ``in`` and ``not in`` operations are used only for simple
containment testing in the general case, some specialised sequences
(such as :class:`str`, :class:`bytes` and :class:`bytearray`) also use
them for subsequence testing:: | Notes:
(1)
While the ``in`` and ``not in`` operations are used only for simple
containment testing in the general case, some specialised sequences
(such as :class:`str`, :class:`bytes` and :class:`bytearray`) also use
them for subsequence testing:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a0a5833d-a931-4192-b4ea-4171783ef212 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,525 | supabase-export-v2 | 2cec8aa2322c95ee | .. method:: bytes.capitalize() bytearray.capitalize()
Return a copy of the sequence with each byte interpreted as an ASCII
character, and the first byte capitalized and the rest lowercased. Non-ASCII byte values are passed through unchanged. | trusted_official_docs | CPython Docs | .. method:: bytes.capitalize() bytearray.capitalize()
Return a copy of the sequence with each byte interpreted as an ASCII
character, and the first byte capitalized and the rest lowercased. Non-ASCII byte values are passed through unchanged. | .. method:: bytes.capitalize() bytearray.capitalize()
Return a copy of the sequence with each byte interpreted as an ASCII
character, and the first byte capitalized and the rest lowercased. Non-ASCII byte values are passed through unchanged. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a16286ec-9fff-4eae-8557-660764148164 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,164 | supabase-export-v2 | 8767e2d7a2c9da35 | See :meth:`removesuffix` for a method that will remove a single suffix string rather than all of a set of characters. For example::
>>> 'Monty Python'.rstrip(' Python')
'M'
>>> 'Monty Python'.removesuffix(' Python')
'Monty' | trusted_official_docs | CPython Docs | See :meth:`removesuffix` for a method that will remove a single suffix string rather than all of a set of characters. For example::
>>> 'Monty Python'.rstrip(' Python')
'M'
>>> 'Monty Python'.removesuffix(' Python')
'Monty' | See :meth:`removesuffix` for a method that will remove a single suffix string rather than all of a set of characters. For example::
>>> 'Monty Python'.rstrip(' Python')
'M'
>>> 'Monty Python'.removesuffix(' Python')
'Monty' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a257c8cf-5b07-485e-9989-eb833f466e45 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,885 | supabase-export-v2 | d51febfbfd8c99b5 | .. hint:: The :meth:`!copy` method is not part of the :class:`~collections.abc.MutableSequence` :class:`~abc.ABC`, but most concrete mutable sequence types provide it.
.. method:: bytearray.extend(iterable, /)
list.extend(iterable, /)
:no-contents-entry:
:no-index-entry:
:no-typesetting:
.. method:: sequence.extend... | trusted_official_docs | CPython Docs | .. hint:: The :meth:`!copy` method is not part of the :class:`~collections.abc.MutableSequence` :class:`~abc.ABC`, but most concrete mutable sequence types provide it.
.. method:: bytearray.extend(iterable, /)
list.extend(iterable, /)
:no-contents-entry:
:no-index-entry:
:no-typesetting:
.. method:: sequence.extend... | .. hint:: The :meth:`!copy` method is not part of the :class:`~collections.abc.MutableSequence` :class:`~abc.ABC`, but most concrete mutable sequence types provide it.
.. method:: bytearray.extend(iterable, /)
list.extend(iterable, /)
:no-contents-entry:
:no-index-entry:
:no-typesetting:
.. method:: sequence.extend... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a2acd391-947f-47a7-95a1-367908a92f67 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,383 | supabase-export-v2 | d56ae2c2c672b183 | .. method:: take_bytes(n=None, /)
Remove the first *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. | trusted_official_docs | CPython Docs | .. method:: take_bytes(n=None, /)
Remove the first *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. | .. method:: take_bytes(n=None, /)
Remove the first *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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a2b24ed5-db83-4be1-a2fe-b12b909d47fc | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,506 | supabase-export-v2 | eb027943fa375a5b | 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'Monty Python'.rstrip(b' Python')
b'M'
>>> b'Monty Python'.removesuffix(b' Python')
b'Monty' | trusted_official_docs | CPython Docs | 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'Monty Python'.rstrip(b' Python')
b'M'
>>> b'Monty Python'.removesuffix(b' Python')
b'Monty' | 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'Monty Python'.rstrip(b' Python')
b'M'
>>> b'Monty Python'.removesuffix(b' Python')
b'Monty' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a3422c44-6ac1-436c-a21b-703481c5d900 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,233 | supabase-export-v2 | 59b648a88093d372 | .. method:: str.zfill(width, /)
Return a copy of the string left filled with ASCII ``'0'`` digits to
make a string of length *width*. A leading sign prefix (``'+'``/``'-'``)
is handled by inserting the padding *after* the sign character rather
than before. The original string is returned if *width* is less than
or ... | trusted_official_docs | CPython Docs | .. method:: str.zfill(width, /)
Return a copy of the string left filled with ASCII ``'0'`` digits to
make a string of length *width*. A leading sign prefix (``'+'``/``'-'``)
is handled by inserting the padding *after* the sign character rather
than before. The original string is returned if *width* is less than
or ... | .. method:: str.zfill(width, /)
Return a copy of the string left filled with ASCII ``'0'`` digits to
make a string of length *width*. A leading sign prefix (``'+'``/``'-'``)
is handled by inserting the padding *after* the sign character rather
than before. The original string is returned if *width* is less than
or ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a4bb5203-df7e-4c44-8a4a-8363ba0d1f44 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,841 | supabase-export-v2 | db1409bdc52eb244 | * If *i* or *j* is greater than ``len(s)``, use ``len(s)``. * If *i* is greater than or equal to *j*, the slice is empty.
(5)
The slice of *s* from *i* to *j* with step *k* is defined as the sequence of
items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other words,
the indices are ``i``, ``i+k``, `... | trusted_official_docs | CPython Docs | * If *i* or *j* is greater than ``len(s)``, use ``len(s)``. * If *i* is greater than or equal to *j*, the slice is empty.
(5)
The slice of *s* from *i* to *j* with step *k* is defined as the sequence of
items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other words,
the indices are ``i``, ``i+k``, `... | * If *i* or *j* is greater than ``len(s)``, use ``len(s)``. * If *i* is greater than or equal to *j*, the slice is empty.
(5)
The slice of *s* from *i* to *j* with step *k* is defined as the sequence of
items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other words,
the indices are ``i``, ``i+k``, `... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a5827ac8-d4f2-40c6-b364-91359dd8fc93 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,700 | supabase-export-v2 | a48ee0d5e276cbe4 | >>> n = -37 >>> bin(n) '-0b100101' >>> n.bit_length() 6
More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the
unique positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. Equivalently, when ``abs(x)`` is small enough to have a correctly
rounded logarithm, then ``k = 1 + int(log(abs(x), 2))``. ... | trusted_official_docs | CPython Docs | >>> n = -37 >>> bin(n) '-0b100101' >>> n.bit_length() 6
More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the
unique positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. Equivalently, when ``abs(x)`` is small enough to have a correctly
rounded logarithm, then ``k = 1 + int(log(abs(x), 2))``. ... | >>> n = -37 >>> bin(n) '-0b100101' >>> n.bit_length() 6
More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the
unique positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. Equivalently, when ``abs(x)`` is small enough to have a correctly
rounded logarithm, then ``k = 1 + int(log(abs(x), 2))``. ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a7343c81-0d70-4fc8-9bae-7a236ff8cd56 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,914 | supabase-export-v2 | 758c202d8787ba3d | .. impl-detail::
While a list is being sorted, the effect of attempting to mutate, or even
inspect, the list is undefined. The C implementation of Python makes the
list appear empty for the duration, and raises :exc:`ValueError` if it can
detect that the list has been mutated during a sort. | trusted_official_docs | CPython Docs | .. impl-detail::
While a list is being sorted, the effect of attempting to mutate, or even
inspect, the list is undefined. The C implementation of Python makes the
list appear empty for the duration, and raises :exc:`ValueError` if it can
detect that the list has been mutated during a sort. | .. impl-detail::
While a list is being sorted, the effect of attempting to mutate, or even
inspect, the list is undefined. The C implementation of Python makes the
list appear empty for the duration, and raises :exc:`ValueError` if it can
detect that the list has been mutated during a sort. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a77cbae5-204d-442a-9ea4-02badb92869e | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,299 | supabase-export-v2 | 6c3f17f5b8e268ea | conversion. | +---------+---------------------------------------------------------------------+ | ``'+'`` | A sign character (``'+'`` or ``'-'``) will precede the conversion | | | (overrides a "space" flag). | +---------+---------------------------------------------------------------------+
A length modifier (``h``, ``... | trusted_official_docs | CPython Docs | conversion. | +---------+---------------------------------------------------------------------+ | ``'+'`` | A sign character (``'+'`` or ``'-'``) will precede the conversion | | | (overrides a "space" flag). | +---------+---------------------------------------------------------------------+
A length modifier (``h``, ``... | conversion. | +---------+---------------------------------------------------------------------+ | ``'+'`` | A sign character (``'+'`` or ``'-'``) will precede the conversion | | | (overrides a "space" flag). | +---------+---------------------------------------------------------------------+
A length modifier (``h``, ``... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a77d0a28-bf96-4053-a02a-25b669e7158c | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,843 | supabase-export-v2 | 2349405907f31c75 | have a quadratic runtime cost in the total sequence length. To get a linear runtime cost, you must switch to one of the alternatives below:
* if concatenating :class:`str` objects, you can build a list and use
:meth:`str.join` at the end or else write to an :class:`io.StringIO`
instance and retrieve its value when co... | trusted_official_docs | CPython Docs | have a quadratic runtime cost in the total sequence length. To get a linear runtime cost, you must switch to one of the alternatives below:
* if concatenating :class:`str` objects, you can build a list and use
:meth:`str.join` at the end or else write to an :class:`io.StringIO`
instance and retrieve its value when co... | have a quadratic runtime cost in the total sequence length. To get a linear runtime cost, you must switch to one of the alternatives below:
* if concatenating :class:`str` objects, you can build a list and use
:meth:`str.join` at the end or else write to an :class:`io.StringIO`
instance and retrieve its value when co... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a7d57b6c-dd28-44ac-ad41-a8024e988abd | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,459 | supabase-export-v2 | 21e0a57a8808a0f3 | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. versionchanged:: 3.15
*count* is now supported as a keyword argument. | 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.
.. versionchanged:: 3.15
*count* is now supported as a keyword argument. | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. versionchanged:: 3.15
*count* is now supported as a keyword argument. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a8450d59-ad77-40f5-b517-7734674d8fe7 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,705 | supabase-export-v2 | eb902335642fad6f | Return the number of ones in the binary representation of the absolute value of the integer. This is also known as the population count. Example::
>>> n = 19
>>> bin(n)
'0b10011'
>>> n.bit_count()
3
>>> (-n).bit_count()
3 | trusted_official_docs | CPython Docs | Return the number of ones in the binary representation of the absolute value of the integer. This is also known as the population count. Example::
>>> n = 19
>>> bin(n)
'0b10011'
>>> n.bit_count()
3
>>> (-n).bit_count()
3 | Return the number of ones in the binary representation of the absolute value of the integer. This is also known as the population count. Example::
>>> n = 19
>>> bin(n)
'0b10011'
>>> n.bit_count()
3
>>> (-n).bit_count()
3 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a8a86802-6b87-4cbb-ad0c-2b78ef4fed9d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,553 | supabase-export-v2 | 98ed8df62857337c | >>> b'hello world'.islower() True >>> b'Hello world'.islower() False
Lowercase ASCII characters are those byte values in the sequence
``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. | trusted_official_docs | CPython Docs | >>> b'hello world'.islower() True >>> b'Hello world'.islower() False
Lowercase ASCII characters are those byte values in the sequence
``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. | >>> b'hello world'.islower() True >>> b'Hello world'.islower() False
Lowercase ASCII characters are those byte values in the sequence
``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a8d83652-1b0a-4f37-9fb0-4ebd5208353d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,826 | supabase-export-v2 | f62c9195f816b63d | function; min pair: built-in function; max pair: concatenation; operation pair: repetition; operation pair: subscript; operation pair: slice; operation pair: operator; in pair: operator; not in
+--------------------------+--------------------------------+----------+
| Operation | Result | Notes |
+=====================... | trusted_official_docs | CPython Docs | function; min pair: built-in function; max pair: concatenation; operation pair: repetition; operation pair: subscript; operation pair: slice; operation pair: operator; in pair: operator; not in
+--------------------------+--------------------------------+----------+
| Operation | Result | Notes |
+=====================... | function; min pair: built-in function; max pair: concatenation; operation pair: repetition; operation pair: subscript; operation pair: slice; operation pair: operator; in pair: operator; not in
+--------------------------+--------------------------------+----------+
| Operation | Result | Notes |
+=====================... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a9d9aaa2-ff5b-4c0e-898c-325ac8114ef9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,171 | supabase-export-v2 | d9458b334849302a | >>> '1,2,3'.split(',') ['1', '2', '3'] >>> '1,2,3'.split(',', maxsplit=1) ['1', '2,3'] >>> '1,2,,3,'.split(',') ['1', '2', '', '3', ''] >>> '1<>2<>3<4'.split('<>') ['1', '2', '3<4']
If *sep* is not specified or is ``None``, a different splitting algorithm is
applied: runs of consecutive whitespace are regarded as a si... | trusted_official_docs | CPython Docs | >>> '1,2,3'.split(',') ['1', '2', '3'] >>> '1,2,3'.split(',', maxsplit=1) ['1', '2,3'] >>> '1,2,,3,'.split(',') ['1', '2', '', '3', ''] >>> '1<>2<>3<4'.split('<>') ['1', '2', '3<4']
If *sep* is not specified or is ``None``, a different splitting algorithm is
applied: runs of consecutive whitespace are regarded as a si... | >>> '1,2,3'.split(',') ['1', '2', '3'] >>> '1,2,3'.split(',', maxsplit=1) ['1', '2,3'] >>> '1,2,,3,'.split(',') ['1', '2', '', '3', ''] >>> '1<>2<>3<4'.split('<>') ['1', '2', '3<4']
If *sep* is not specified or is ``None``, a different splitting algorithm is
applied: runs of consecutive whitespace are regarded as a si... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aa8fffed-116b-420e-b206-f7349307854b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,293 | supabase-export-v2 | 09740770bc910438 | mapping key into that dictionary inserted immediately after the ``'%'`` character. The mapping key selects the value to be formatted from the mapping. For example:
>>> print('%(language)s has %(number)03d quote types.' %
... {'language': "Python", "number": 2})
Python has 002 quote types. | trusted_official_docs | CPython Docs | mapping key into that dictionary inserted immediately after the ``'%'`` character. The mapping key selects the value to be formatted from the mapping. For example:
>>> print('%(language)s has %(number)03d quote types.' %
... {'language': "Python", "number": 2})
Python has 002 quote types. | mapping key into that dictionary inserted immediately after the ``'%'`` character. The mapping key selects the value to be formatted from the mapping. For example:
>>> print('%(language)s has %(number)03d quote types.' %
... {'language': "Python", "number": 2})
Python has 002 quote types. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aacb0bb1-1ee9-491d-bccb-37f7b8b59da8 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,148 | supabase-export-v2 | dd11acccd1ac03f0 | .. method:: str.rjust(width, fillchar=' ', /)
Return the string right justified in a string of length *width*. Padding is
done using the specified *fillchar* (default is an ASCII space). The
original string is returned if *width* is less than or equal to ``len(s)``. | trusted_official_docs | CPython Docs | .. method:: str.rjust(width, fillchar=' ', /)
Return the string right justified in a string of length *width*. Padding is
done using the specified *fillchar* (default is an ASCII space). The
original string is returned if *width* is less than or equal to ``len(s)``. | .. method:: str.rjust(width, fillchar=' ', /)
Return the string right justified in a string of length *width*. Padding is
done using the specified *fillchar* (default is an ASCII space). The
original string is returned if *width* is less than or equal to ``len(s)``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aaeddc0f-2215-43fd-9d4f-37aff910e1ed | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,023 | supabase-export-v2 | 142dc9cdf089cb52 | .. method:: str.format(*args, **kwargs)
Perform a string formatting operation. The string on which this method is
called can contain literal text or replacement fields delimited by braces
``{}``. Each replacement field contains either the numeric index of a
positional argument, or the name of a keyword argument. Ret... | trusted_official_docs | CPython Docs | .. method:: str.format(*args, **kwargs)
Perform a string formatting operation. The string on which this method is
called can contain literal text or replacement fields delimited by braces
``{}``. Each replacement field contains either the numeric index of a
positional argument, or the name of a keyword argument. Ret... | .. method:: str.format(*args, **kwargs)
Perform a string formatting operation. The string on which this method is
called can contain literal text or replacement fields delimited by braces
``{}``. Each replacement field contains either the numeric index of a
positional argument, or the name of a keyword argument. Ret... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aba4271f-66e7-4609-9325-5e6a023a42aa | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,529 | supabase-export-v2 | 9d28205159628562 | .. method:: bytes.expandtabs(tabsize=8) bytearray.expandtabs(tabsize=8)
Return a copy of the sequence where all ASCII tab characters are replaced
by one or more ASCII spaces, depending on the current column and the given
tab size. Tab positions occur every *tabsize* bytes (default is 8,
giving tab positions at colum... | trusted_official_docs | CPython Docs | .. method:: bytes.expandtabs(tabsize=8) bytearray.expandtabs(tabsize=8)
Return a copy of the sequence where all ASCII tab characters are replaced
by one or more ASCII spaces, depending on the current column and the given
tab size. Tab positions occur every *tabsize* bytes (default is 8,
giving tab positions at colum... | .. method:: bytes.expandtabs(tabsize=8) bytearray.expandtabs(tabsize=8)
Return a copy of the sequence where all ASCII tab characters are replaced
by one or more ASCII spaces, depending on the current column and the given
tab size. Tab positions occur every *tabsize* bytes (default is 8,
giving tab positions at colum... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aca2683b-14b4-4cc3-92a5-026314f570e8 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,518 | supabase-export-v2 | bae7ea3187bc84f5 | .. method:: bytes.strip(bytes=None, /) bytearray.strip(bytes=None, /)
Return a copy of the sequence with specified leading and trailing bytes
removed. The *bytes* argument is a binary sequence specifying the set of
byte values to be removed. If omitted or ``None``, the *bytes*
argument defaults to removing ASCII whi... | trusted_official_docs | CPython Docs | .. method:: bytes.strip(bytes=None, /) bytearray.strip(bytes=None, /)
Return a copy of the sequence with specified leading and trailing bytes
removed. The *bytes* argument is a binary sequence specifying the set of
byte values to be removed. If omitted or ``None``, the *bytes*
argument defaults to removing ASCII whi... | .. method:: bytes.strip(bytes=None, /) bytearray.strip(bytes=None, /)
Return a copy of the sequence with specified leading and trailing bytes
removed. The *bytes* argument is a binary sequence specifying the set of
byte values to be removed. If omitted or ``None``, the *bytes*
argument defaults to removing ASCII whi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
acfa3147-ee59-4715-89e1-ad93ebd0f38a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,681 | supabase-export-v2 | ee380ec7e55ed1fd | b True >>> x.tolist() == a.tolist() == y.tolist() == b.tolist() True >>> z = y[::-2] >>> z == c True >>> z.tolist() == c.tolist() True
If either format string is not supported by the :mod:`struct` module,
then the objects will always compare as unequal (even if the format
strings and buffer contents are identical):: | trusted_official_docs | CPython Docs | b True >>> x.tolist() == a.tolist() == y.tolist() == b.tolist() True >>> z = y[::-2] >>> z == c True >>> z.tolist() == c.tolist() True
If either format string is not supported by the :mod:`struct` module,
then the objects will always compare as unequal (even if the format
strings and buffer contents are identical):: | b True >>> x.tolist() == a.tolist() == y.tolist() == b.tolist() True >>> z = y[::-2] >>> z == c True >>> z.tolist() == c.tolist() True
If either format string is not supported by the :mod:`struct` module,
then the objects will always compare as unequal (even if the format
strings and buffer contents are identical):: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ad97e767-f5b2-4435-9c53-5ba5803999b9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,310 | supabase-export-v2 | bb86af13b5671157 | (3) The alternate form causes the result to always contain a decimal point, even if no digits follow it.
The precision determines the number of digits after the decimal point and
defaults to 6. | trusted_official_docs | CPython Docs | (3) The alternate form causes the result to always contain a decimal point, even if no digits follow it.
The precision determines the number of digits after the decimal point and
defaults to 6. | (3) The alternate form causes the result to always contain a decimal point, even if no digits follow it.
The precision determines the number of digits after the decimal point and
defaults to 6. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aeb91269-9e12-44de-8722-a1b0fc11c53a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,962 | supabase-export-v2 | f03f007702663d29 | single expression and have only whitespace between them will be implicitly converted to a single string literal. That is, ``("spam " "eggs") == "spam eggs"``.
See :ref:`strings` for more about the various forms of string literal,
including supported :ref:`escape sequences <escape-sequences>`, and the ``r`` ("raw") pref... | trusted_official_docs | CPython Docs | single expression and have only whitespace between them will be implicitly converted to a single string literal. That is, ``("spam " "eggs") == "spam eggs"``.
See :ref:`strings` for more about the various forms of string literal,
including supported :ref:`escape sequences <escape-sequences>`, and the ``r`` ("raw") pref... | single expression and have only whitespace between them will be implicitly converted to a single string literal. That is, ``("spam " "eggs") == "spam eggs"``.
See :ref:`strings` for more about the various forms of string literal,
including supported :ref:`escape sequences <escape-sequences>`, and the ``r`` ("raw") pref... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b05909da-f619-4de6-9df2-b681dad7fdd1 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,976 | supabase-export-v2 | f945fbee68d642c4 | >>> str(b'Zoot!') "b'Zoot!'"
For more information on the ``str`` class and 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. | trusted_official_docs | CPython Docs | >>> str(b'Zoot!') "b'Zoot!'"
For more information on the ``str`` class and 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. | >>> str(b'Zoot!') "b'Zoot!'"
For more information on the ``str`` class and 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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b0d358f6-8c45-4893-91dc-9aaf2f646344 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,671 | supabase-export-v2 | f054b3ca4cbbac9d | is not necessarily :class:`int`. The result is always rounded towards minus infinity: ``1//2`` is ``0``, ``(-1)//2`` is ``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//(-2)`` is ``0``.
(2)
Not for complex numbers. Instead convert to floats using :func:`abs` if
appropriate. | trusted_official_docs | CPython Docs | is not necessarily :class:`int`. The result is always rounded towards minus infinity: ``1//2`` is ``0``, ``(-1)//2`` is ``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//(-2)`` is ``0``.
(2)
Not for complex numbers. Instead convert to floats using :func:`abs` if
appropriate. | is not necessarily :class:`int`. The result is always rounded towards minus infinity: ``1//2`` is ``0``, ``(-1)//2`` is ``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//(-2)`` is ``0``.
(2)
Not for complex numbers. Instead convert to floats using :func:`abs` if
appropriate. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b103b26d-cb15-4e80-8122-0170b7ffb2a8 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,690 | supabase-export-v2 | 8966cf42fa18d2a5 | physical memory. In particular, in-memory Fortran order is preserved. For non-contiguous views, the data is converted to C first. *order=None* is the same as *order='C'*.
.. method:: hex(*, bytes_per_sep=1)
hex(sep, bytes_per_sep=1) | trusted_official_docs | CPython Docs | physical memory. In particular, in-memory Fortran order is preserved. For non-contiguous views, the data is converted to C first. *order=None* is the same as *order='C'*.
.. method:: hex(*, bytes_per_sep=1)
hex(sep, bytes_per_sep=1) | physical memory. In particular, in-memory Fortran order is preserved. For non-contiguous views, the data is converted to C first. *order=None* is the same as *order='C'*.
.. method:: hex(*, bytes_per_sep=1)
hex(sep, bytes_per_sep=1) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b16edb40-90b9-400a-af2e-656660842f74 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,591 | supabase-export-v2 | b3a6dd8534981ae0 | >>> b'Hello world'.title() b'Hello World'
Lowercase ASCII characters are those byte values in the sequence
``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. All other byte values are uncased. | trusted_official_docs | CPython Docs | >>> b'Hello world'.title() b'Hello World'
Lowercase ASCII characters are those byte values in the sequence
``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. All other byte values are uncased. | >>> b'Hello world'.title() b'Hello World'
Lowercase ASCII characters are those byte values in the sequence
``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters
are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. All other byte values are uncased. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b176e62b-2314-4a8c-aafe-b59dd05b6767 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,492 | supabase-export-v2 | 9deb4b870843f682 | >>> b' spacious '.lstrip() b'spacious ' >>> b'www.example.com'.lstrip(b'cmowz.') b'example.com'
The binary sequence of byte values to remove may be any
:term:`bytes-like object`. See :meth:`~bytes.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 | >>> b' spacious '.lstrip() b'spacious ' >>> b'www.example.com'.lstrip(b'cmowz.') b'example.com'
The binary sequence of byte values to remove may be any
:term:`bytes-like object`. See :meth:`~bytes.removeprefix` for a method
that will remove a single prefix string rather than all of a set of
characters. For example:: | >>> b' spacious '.lstrip() b'spacious ' >>> b'www.example.com'.lstrip(b'cmowz.') b'example.com'
The binary sequence of byte values to remove may be any
:term:`bytes-like object`. See :meth:`~bytes.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 | |
b23aff06-5168-40bc-ae3f-23677dc692d1 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,577 | supabase-export-v2 | cdf01692c3476ff2 | >>> b'ab c\n\nde fg\rkl\r\n'.splitlines() [b'ab c', b'', b'de fg', b'kl'] >>> b'ab c\n\nde fg\rkl\r\n'.splitlines(keepends=True) [b'ab c\n', b'\n', b'de fg\r', b'kl\r\n']
Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this
method returns an empty list for the empty string, and a terminal line
bre... | trusted_official_docs | CPython Docs | >>> b'ab c\n\nde fg\rkl\r\n'.splitlines() [b'ab c', b'', b'de fg', b'kl'] >>> b'ab c\n\nde fg\rkl\r\n'.splitlines(keepends=True) [b'ab c\n', b'\n', b'de fg\r', b'kl\r\n']
Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this
method returns an empty list for the empty string, and a terminal line
bre... | >>> b'ab c\n\nde fg\rkl\r\n'.splitlines() [b'ab c', b'', b'de fg', b'kl'] >>> b'ab c\n\nde fg\rkl\r\n'.splitlines(keepends=True) [b'ab c\n', b'\n', b'de fg\r', b'kl\r\n']
Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this
method returns an empty list for the empty string, and a terminal line
bre... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b2d2d215-1692-4cc8-ba5a-c80f95831093 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,887 | supabase-export-v2 | aac702d460cbca9d | 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.insert(index, value, /)
list.insert(index, value, /)
:no-contents-entry:
:no-index-entry:
:no-typesetting:
.. method:: sequence.insert(index, value, /) | trusted_official_docs | CPython Docs | 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.insert(index, value, /)
list.insert(index, value, /)
:no-contents-entry:
:no-index-entry:
:no-typesetting:
.. method:: sequence.insert(index, value, /) | 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.insert(index, value, /)
list.insert(index, value, /)
:no-contents-entry:
:no-index-entry:
:no-typesetting:
.. method:: sequence.insert(index, value, /) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b2f41e08-16db-4cc8-8673-5501d094b5d8 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,406 | supabase-export-v2 | e3e8846a138afd50 | Return the number of non-overlapping occurrences of subsequence *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation.
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 | Return the number of non-overlapping occurrences of subsequence *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation.
The subsequence to search for may be any :term:`bytes-like object` or an
integer in the range 0 to 255. | Return the number of non-overlapping occurrences of subsequence *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation.
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 | |
b2f5caf6-9bab-4289-acfa-600e5e2f64be | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,407 | supabase-export-v2 | 2371d3fcb720815a | The subsequence to search for may be any :term:`bytes-like object` or an integer in the range 0 to 255.
If *sub* is empty, returns the number of empty slices between characters
which is the length of the bytes object plus one. | trusted_official_docs | CPython Docs | The subsequence to search for may be any :term:`bytes-like object` or an integer in the range 0 to 255.
If *sub* is empty, returns the number of empty slices between characters
which is the length of the bytes object plus one. | The subsequence to search for may be any :term:`bytes-like object` or an integer in the range 0 to 255.
If *sub* is empty, returns the number of empty slices between characters
which is the length of the bytes object plus one. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b2f5f7b4-6475-4f6d-92d2-99d5763a9e87 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,712 | supabase-export-v2 | a0b82eabaf2737cd | >>> (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((x.bit_length() + 7) // 8, byteorder='little') b'\xe8\x0... | trusted_official_docs | CPython Docs | >>> (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((x.bit_length() + 7) // 8, byteorder='little') b'\xe8\x0... | >>> (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((x.bit_length() + 7) // 8, byteorder='little') b'\xe8\x0... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b3246efe-5ae8-4555-9976-75ee9762b7ce | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,717 | supabase-export-v2 | 988a22ccff9d6bf4 | Cast 1D/bytes to 3D/ints to 1D/signed char::
>>> import struct
>>> buf = struct.pack("i"*12, *list(range(12)))
>>> x = memoryview(buf)
>>> y = x.cast('i', shape=[2,2,3])
>>> y.tolist()
[[[0, 1, 2], [3, 4, 5]], [[6, 7, 8], [9, 10, 11]]]
>>> y.format
'i'
>>> y.itemsize
4
>>> len(y)
2
>>> y.nbytes
48
>>> z =... | trusted_official_docs | CPython Docs | Cast 1D/bytes to 3D/ints to 1D/signed char::
>>> import struct
>>> buf = struct.pack("i"*12, *list(range(12)))
>>> x = memoryview(buf)
>>> y = x.cast('i', shape=[2,2,3])
>>> y.tolist()
[[[0, 1, 2], [3, 4, 5]], [[6, 7, 8], [9, 10, 11]]]
>>> y.format
'i'
>>> y.itemsize
4
>>> len(y)
2
>>> y.nbytes
48
>>> z =... | Cast 1D/bytes to 3D/ints to 1D/signed char::
>>> import struct
>>> buf = struct.pack("i"*12, *list(range(12)))
>>> x = memoryview(buf)
>>> y = x.cast('i', shape=[2,2,3])
>>> y.tolist()
[[[0, 1, 2], [3, 4, 5]], [[6, 7, 8], [9, 10, 11]]]
>>> y.format
'i'
>>> y.itemsize
4
>>> len(y)
2
>>> y.nbytes
48
>>> z =... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b3300882-b3e2-4ca3-b45b-5d17ce2beb91 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,662 | supabase-export-v2 | e0db63895da1e31b | Arithmetic with complex and real operands is defined by the usual mathematical formula, for example::
x + complex(u, v) = complex(x + u, v)
x * complex(u, v) = complex(x * u, x * v) | trusted_official_docs | CPython Docs | Arithmetic with complex and real operands is defined by the usual mathematical formula, for example::
x + complex(u, v) = complex(x + u, v)
x * complex(u, v) = complex(x * u, x * v) | Arithmetic with complex and real operands is defined by the usual mathematical formula, for example::
x + complex(u, v) = complex(x + u, v)
x * complex(u, v) = complex(x * u, x * v) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b36a5d3e-47d1-4a16-9a0f-4a6fdda24e3f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,924 | supabase-export-v2 | 6c241c52e11fb8da | ``f(a, b, c)`` is a function call with three arguments, while ``f((a, b, c))`` is a function call with a 3-tuple as the sole argument.
Tuples implement all of the :ref:`common <typesseq-common>` sequence
operations. | trusted_official_docs | CPython Docs | ``f(a, b, c)`` is a function call with three arguments, while ``f((a, b, c))`` is a function call with a 3-tuple as the sole argument.
Tuples implement all of the :ref:`common <typesseq-common>` sequence
operations. | ``f(a, b, c)`` is a function call with three arguments, while ``f((a, b, c))`` is a function call with a 3-tuple as the sole argument.
Tuples implement all of the :ref:`common <typesseq-common>` sequence
operations. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b3eef5af-272a-4c74-9067-468d32f86c78 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,936 | supabase-export-v2 | 013c4801d8bbe1b4 | [0, 3, 6, 9] >>> list(range(0, -10, -1)) [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] >>> list(range(0)) [] >>> list(range(1, 0)) []
Ranges implement all of the :ref:`common <typesseq-common>` sequence operations
except concatenation and repetition (due to the fact that range objects can
only represent sequences that foll... | trusted_official_docs | CPython Docs | [0, 3, 6, 9] >>> list(range(0, -10, -1)) [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] >>> list(range(0)) [] >>> list(range(1, 0)) []
Ranges implement all of the :ref:`common <typesseq-common>` sequence operations
except concatenation and repetition (due to the fact that range objects can
only represent sequences that foll... | [0, 3, 6, 9] >>> list(range(0, -10, -1)) [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] >>> list(range(0)) [] >>> list(range(1, 0)) []
Ranges implement all of the :ref:`common <typesseq-common>` sequence operations
except concatenation and repetition (due to the fact that range objects can
only represent sequences that foll... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b5337215-5675-4e6c-8c25-1161388fb352 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,288 | supabase-export-v2 | 3762ec93cf1e837d | #. Conversion flags (optional), which affect the result of some conversion types.
#. Minimum field width (optional). If specified as an ``'*'`` (asterisk), the
actual width is read from the next element of the tuple in *values*, and the
object to convert comes after the minimum field width and optional precision. | trusted_official_docs | CPython Docs | #. Conversion flags (optional), which affect the result of some conversion types.
#. Minimum field width (optional). If specified as an ``'*'`` (asterisk), the
actual width is read from the next element of the tuple in *values*, and the
object to convert comes after the minimum field width and optional precision. | #. Conversion flags (optional), which affect the result of some conversion types.
#. Minimum field width (optional). If specified as an ``'*'`` (asterisk), the
actual width is read from the next element of the tuple in *values*, and the
object to convert comes after the minimum field width and optional precision. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b54d8c0c-afdc-4dc3-bedd-a1d49b2dc2b3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,854 | supabase-export-v2 | 2bbad43f86475514 | .. method:: list.index(value[, start[, stop]]) range.index(value[, start[, stop]]) tuple.index(value[, start[, stop]]) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.index(value[, start[, stop]])
Return the index of the first occurrence of *value* in *sequence*. | trusted_official_docs | CPython Docs | .. method:: list.index(value[, start[, stop]]) range.index(value[, start[, stop]]) tuple.index(value[, start[, stop]]) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.index(value[, start[, stop]])
Return the index of the first occurrence of *value* in *sequence*. | .. method:: list.index(value[, start[, stop]]) range.index(value[, start[, stop]]) tuple.index(value[, start[, stop]]) :no-contents-entry: :no-index-entry: :no-typesetting: .. method:: sequence.index(value[, start[, stop]])
Return the index of the first occurrence of *value* in *sequence*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b5d04774-9ee8-4db6-98f5-a50ee5c6e929 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,268 | supabase-export-v2 | da6e879c438d2141 | An :dfn:`t-string` (formally a :dfn:`template string literal`) is a string literal that is prefixed with ``t`` or ``T``.
These strings follow the same syntax and evaluation rules as
:ref:`formatted string literals <stdtypes-fstrings>`,
with for the following differences: | trusted_official_docs | CPython Docs | An :dfn:`t-string` (formally a :dfn:`template string literal`) is a string literal that is prefixed with ``t`` or ``T``.
These strings follow the same syntax and evaluation rules as
:ref:`formatted string literals <stdtypes-fstrings>`,
with for the following differences: | An :dfn:`t-string` (formally a :dfn:`template string literal`) is a string literal that is prefixed with ``t`` or ``T``.
These strings follow the same syntax and evaluation rules as
:ref:`formatted string literals <stdtypes-fstrings>`,
with for the following differences: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b6dcb2fb-d975-4521-9f3a-79450e9ebd4b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,654 | supabase-export-v2 | af7d54e3f0dd4b9a | number *z*, use ``z.real`` and ``z.imag``. (The standard library includes the additional numeric types :mod:`fractions.Fraction`, for rationals, and :mod:`decimal.Decimal`, for floating-point numbers with user-definable precision.)
.. index::
pair: numeric; literals
pair: integer; literals
pair: floating-point; lite... | trusted_official_docs | CPython Docs | number *z*, use ``z.real`` and ``z.imag``. (The standard library includes the additional numeric types :mod:`fractions.Fraction`, for rationals, and :mod:`decimal.Decimal`, for floating-point numbers with user-definable precision.)
.. index::
pair: numeric; literals
pair: integer; literals
pair: floating-point; lite... | number *z*, use ``z.real`` and ``z.imag``. (The standard library includes the additional numeric types :mod:`fractions.Fraction`, for rationals, and :mod:`decimal.Decimal`, for floating-point numbers with user-definable precision.)
.. index::
pair: numeric; literals
pair: integer; literals
pair: floating-point; lite... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b7811f78-0d57-43af-aa68-e92aae8481bd | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,862 | supabase-export-v2 | d3e922e1d86e71a3 | The only operation that immutable sequence types generally implement that is not also implemented by mutable sequence types is support for the :func:`hash` built-in.
This support allows immutable sequences, such as :class:`tuple` instances, to
be used as :class:`dict` keys and stored in :class:`set` and :class:`frozens... | trusted_official_docs | CPython Docs | The only operation that immutable sequence types generally implement that is not also implemented by mutable sequence types is support for the :func:`hash` built-in.
This support allows immutable sequences, such as :class:`tuple` instances, to
be used as :class:`dict` keys and stored in :class:`set` and :class:`frozens... | The only operation that immutable sequence types generally implement that is not also implemented by mutable sequence types is support for the :func:`hash` built-in.
This support allows immutable sequences, such as :class:`tuple` instances, to
be used as :class:`dict` keys and stored in :class:`set` and :class:`frozens... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b84d14f7-a62d-4184-b3af-3ab3b23ecffe | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,482 | supabase-export-v2 | f1b8b4eaa5ae389f | .. method:: bytes.center(width, fillbyte=b' ', /) bytearray.center(width, fillbyte=b' ', /)
Return a copy of the object centered in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII
space). For :class:`bytes` objects, the original sequence is returned if
*width* is less... | trusted_official_docs | CPython Docs | .. method:: bytes.center(width, fillbyte=b' ', /) bytearray.center(width, fillbyte=b' ', /)
Return a copy of the object centered in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII
space). For :class:`bytes` objects, the original sequence is returned if
*width* is less... | .. method:: bytes.center(width, fillbyte=b' ', /) bytearray.center(width, fillbyte=b' ', /)
Return a copy of the object centered in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII
space). For :class:`bytes` objects, the original sequence is returned if
*width* is less... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b87e327e-ddcb-4548-90ab-3395421941bf | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,959 | supabase-export-v2 | c6c6ed5e0ee20483 | 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:
* Single quotes: ``'allows embedded "double" quotes'``
* Double quotes: ``"allows embedded 'single' quotes"``
* Triple quoted: ``'''Three s... | trusted_official_docs | CPython Docs | 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:
* Single quotes: ``'allows embedded "double" quotes'``
* Double quotes: ``"allows embedded 'single' quotes"``
* Triple quoted: ``'''Three s... | 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:
* Single quotes: ``'allows embedded "double" quotes'``
* Double quotes: ``"allows embedded 'single' quotes"``
* Triple quoted: ``'''Three s... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b8a1c4a1-2806-43d3-84e3-2ab1fd0cfc1f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,635 | supabase-export-v2 | 72b06df250514ea2 | (1) This is a short-circuit operator, so it only evaluates the second argument if the first one is false.
(2)
This is a short-circuit operator, so it only evaluates the second
argument if the first one is true. | trusted_official_docs | CPython Docs | (1) This is a short-circuit operator, so it only evaluates the second argument if the first one is false.
(2)
This is a short-circuit operator, so it only evaluates the second
argument if the first one is true. | (1) This is a short-circuit operator, so it only evaluates the second argument if the first one is false.
(2)
This is a short-circuit operator, so it only evaluates the second
argument if the first one is true. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b8e09d39-42cf-4850-8865-1eac2ca67b70 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,160 | supabase-export-v2 | c99f71869113bed2 | .. method:: str.rstrip(chars=None, /)
Return a copy of the string with trailing 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 suffix; rather, all combinat... | trusted_official_docs | CPython Docs | .. method:: str.rstrip(chars=None, /)
Return a copy of the string with trailing 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 suffix; rather, all combinat... | .. method:: str.rstrip(chars=None, /)
Return a copy of the string with trailing 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 suffix; rather, all combinat... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b953d741-98c7-45c6-b106-a323f4caf3fb | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,333 | supabase-export-v2 | f6fb4823e34d15c0 | case for arbitrary binary data (blindly applying text processing algorithms to binary data formats that are not ASCII compatible will usually lead to data corruption).
In addition to the literal forms, bytes objects can be created in a number of
other ways: | trusted_official_docs | CPython Docs | case for arbitrary binary data (blindly applying text processing algorithms to binary data formats that are not ASCII compatible will usually lead to data corruption).
In addition to the literal forms, bytes objects can be created in a number of
other ways: | case for arbitrary binary data (blindly applying text processing algorithms to binary data formats that are not ASCII compatible will usually lead to data corruption).
In addition to the literal forms, bytes objects can be created in a number of
other ways: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b9d902e6-2501-4f64-8b85-0f6ed6ddaaaf | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,224 | supabase-export-v2 | b6175d4ac5bc7a95 | or more other characters; return ``None``, to delete the character from the return string; or raise a :exc:`LookupError` exception, to map the character to itself.
You can use :meth:`str.maketrans` to create a translation map from
character-to-character mappings in different formats. | trusted_official_docs | CPython Docs | or more other characters; return ``None``, to delete the character from the return string; or raise a :exc:`LookupError` exception, to map the character to itself.
You can use :meth:`str.maketrans` to create a translation map from
character-to-character mappings in different formats. | or more other characters; return ``None``, to delete the character from the return string; or raise a :exc:`LookupError` exception, to map the character to itself.
You can use :meth:`str.maketrans` to create a translation map from
character-to-character mappings in different formats. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b9f443ac-7548-4cd4-a27a-bf3e853ceb57 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,674 | supabase-export-v2 | a4e0487c7d18de3e | Conversion from :class:`float` to :class:`int` truncates, discarding the fractional part. See functions :func:`math.floor` and :func:`math.ceil` for alternative conversions.
(4)
float also accepts the strings "nan" and "inf" with an optional prefix "+"
or "-" for Not a Number (NaN) and positive or negative infinity. | trusted_official_docs | CPython Docs | Conversion from :class:`float` to :class:`int` truncates, discarding the fractional part. See functions :func:`math.floor` and :func:`math.ceil` for alternative conversions.
(4)
float also accepts the strings "nan" and "inf" with an optional prefix "+"
or "-" for Not a Number (NaN) and positive or negative infinity. | Conversion from :class:`float` to :class:`int` truncates, discarding the fractional part. See functions :func:`math.floor` and :func:`math.ceil` for alternative conversions.
(4)
float also accepts the strings "nan" and "inf" with an optional prefix "+"
or "-" for Not a Number (NaN) and positive or negative infinity. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ba113546-d340-4f02-89bb-bf164998960f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,335 | supabase-export-v2 | a1dda4fe22fa42a4 | zero-filled bytes object of a specified length: ``bytes(10)`` * From an iterable of integers: ``bytes(range(20))`` * Copying existing binary data via the buffer protocol: ``bytes(obj)``
Also see the :ref:`bytes <func-bytes>` built-in. | trusted_official_docs | CPython Docs | zero-filled bytes object of a specified length: ``bytes(10)`` * From an iterable of integers: ``bytes(range(20))`` * Copying existing binary data via the buffer protocol: ``bytes(obj)``
Also see the :ref:`bytes <func-bytes>` built-in. | zero-filled bytes object of a specified length: ``bytes(10)`` * From an iterable of integers: ``bytes(range(20))`` * Copying existing binary data via the buffer protocol: ``bytes(obj)``
Also see the :ref:`bytes <func-bytes>` built-in. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ba389cb6-f29a-4771-81e0-5e0c489c1f62 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,083 | supabase-export-v2 | 901812448f4902fc | .. method:: str.istitle()
Return ``True`` if the string is a titlecased string and there is at least one
character, for example uppercase characters may only follow uncased characters
and lowercase characters only cased ones. Return ``False`` otherwise. | trusted_official_docs | CPython Docs | .. method:: str.istitle()
Return ``True`` if the string is a titlecased string and there is at least one
character, for example uppercase characters may only follow uncased characters
and lowercase characters only cased ones. Return ``False`` otherwise. | .. method:: str.istitle()
Return ``True`` if the string is a titlecased string and there is at least one
character, for example uppercase characters may only follow uncased characters
and lowercase characters only cased ones. Return ``False`` otherwise. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ba93a3f5-ce04-4d7d-a57d-29fd05c3a128 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,065 | supabase-export-v2 | 2393534fc2868ed4 | .. method:: str.isnumeric()
Return ``True`` if all characters in the string are numeric
characters, and there is at least one character, ``False``
otherwise. Numeric characters include digit characters, and all characters
that have the Unicode numeric value property, e.g. U+2155,
VULGAR FRACTION ONE FIFTH. Formally... | trusted_official_docs | CPython Docs | .. method:: str.isnumeric()
Return ``True`` if all characters in the string are numeric
characters, and there is at least one character, ``False``
otherwise. Numeric characters include digit characters, and all characters
that have the Unicode numeric value property, e.g. U+2155,
VULGAR FRACTION ONE FIFTH. Formally... | .. method:: str.isnumeric()
Return ``True`` if all characters in the string are numeric
characters, and there is at least one character, ``False``
otherwise. Numeric characters include digit characters, and all characters
that have the Unicode numeric value property, e.g. U+2155,
VULGAR FRACTION ONE FIFTH. Formally... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
baaa5cbd-1374-442f-979a-ef9f47f409c4 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,497 | supabase-export-v2 | e82ade84925c7d4f | .. method:: bytes.rjust(width, fillbyte=b' ', /) bytearray.rjust(width, fillbyte=b' ', /)
Return a copy of the object right justified in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII
space). For :class:`bytes` objects, the original sequence is returned if
*width* is... | trusted_official_docs | CPython Docs | .. method:: bytes.rjust(width, fillbyte=b' ', /) bytearray.rjust(width, fillbyte=b' ', /)
Return a copy of the object right justified in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII
space). For :class:`bytes` objects, the original sequence is returned if
*width* is... | .. method:: bytes.rjust(width, fillbyte=b' ', /) bytearray.rjust(width, fillbyte=b' ', /)
Return a copy of the object right justified in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII
space). For :class:`bytes` objects, the original sequence is returned if
*width* is... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bb9f137b-d565-4c26-b63a-c25e3b5954a8 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,003 | supabase-export-v2 | 5a78d1aa29c1f296 | *encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for possible values.
*errors* controls how encoding errors are handled. If ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``,
``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and ... | trusted_official_docs | CPython Docs | *encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for possible values.
*errors* controls how encoding errors are handled. If ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``,
``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and ... | *encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for possible values.
*errors* controls how encoding errors are handled. If ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``,
``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bc0648ff-a284-4cbf-bac4-b7d6336a6fd8 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,088 | supabase-export-v2 | 82c37f0770d02a65 | Return ``True`` if all cased characters [4]_ in the string are uppercase and there is at least one cased character, ``False`` otherwise.
>>> 'BANANA'.isupper()
True
>>> 'banana'.isupper()
False
>>> 'baNana'.isupper()
False
>>> ' '.isupper()
False | trusted_official_docs | CPython Docs | Return ``True`` if all cased characters [4]_ in the string are uppercase and there is at least one cased character, ``False`` otherwise.
>>> 'BANANA'.isupper()
True
>>> 'banana'.isupper()
False
>>> 'baNana'.isupper()
False
>>> ' '.isupper()
False | Return ``True`` if all cased characters [4]_ in the string are uppercase and there is at least one cased character, ``False`` otherwise.
>>> 'BANANA'.isupper()
True
>>> 'banana'.isupper()
False
>>> 'baNana'.isupper()
False
>>> ' '.isupper()
False | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
be148e8f-1c16-4e82-b613-c7bc41bbd87f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,773 | supabase-export-v2 | ecba7dc616f5b9de | .. impl-detail::
Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C
longs and ``P = 2**61 - 1`` on machines with 64-bit C longs. | trusted_official_docs | CPython Docs | .. impl-detail::
Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C
longs and ``P = 2**61 - 1`` on machines with 64-bit C longs. | .. impl-detail::
Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C
longs and ``P = 2**61 - 1`` on machines with 64-bit C longs. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
be9651f1-184c-4bc9-823f-89dd0df6b8de | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,304 | supabase-export-v2 | 7ee0ad8f3186004e | single | | | | character string). | | +------------+-----------------------------------------------------+-------+ | ``'r'`` | String (converts any Python object using | \(5) | | | :func:`repr`).
| |
+------------+-----------------------------------------------------+-------+
| ``'s'`` | String (converts any Python obj... | trusted_official_docs | CPython Docs | single | | | | character string). | | +------------+-----------------------------------------------------+-------+ | ``'r'`` | String (converts any Python object using | \(5) | | | :func:`repr`).
| |
+------------+-----------------------------------------------------+-------+
| ``'s'`` | String (converts any Python obj... | single | | | | character string). | | +------------+-----------------------------------------------------+-------+ | ``'r'`` | String (converts any Python object using | \(5) | | | :func:`repr`).
| |
+------------+-----------------------------------------------------+-------+
| ``'s'`` | String (converts any Python obj... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bee5ceba-c8e6-4789-9318-c9c749590601 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,848 | supabase-export-v2 | 79a4f7e08a96b168 | (7) Some sequence types (such as :class:`range`) only support item sequences that follow specific patterns, and hence don't support sequence concatenation or repetition.
(8)
An :exc:`IndexError` is raised if *i* is outside the sequence range. | trusted_official_docs | CPython Docs | (7) Some sequence types (such as :class:`range`) only support item sequences that follow specific patterns, and hence don't support sequence concatenation or repetition.
(8)
An :exc:`IndexError` is raised if *i* is outside the sequence range. | (7) Some sequence types (such as :class:`range`) only support item sequences that follow specific patterns, and hence don't support sequence concatenation or repetition.
(8)
An :exc:`IndexError` is raised if *i* is outside the sequence range. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bf307f93-bef7-4972-a716-e7a2fcc982ad | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,613 | supabase-export-v2 | d389a5da3087f1f1 | The principal built-in types are numerics, sequences, mappings, classes, instances and exceptions.
Some collection classes are mutable. The methods that add, subtract, or
rearrange their members in place, and don't return a specific item, never return
the collection instance itself but ``None``. | trusted_official_docs | CPython Docs | The principal built-in types are numerics, sequences, mappings, classes, instances and exceptions.
Some collection classes are mutable. The methods that add, subtract, or
rearrange their members in place, and don't return a specific item, never return
the collection instance itself but ``None``. | The principal built-in types are numerics, sequences, mappings, classes, instances and exceptions.
Some collection classes are mutable. The methods that add, subtract, or
rearrange their members in place, and don't return a specific item, never return
the collection instance itself but ``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bf844120-760e-4a3a-9989-de94c56f09d9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,998 | supabase-export-v2 | 733098e661aa5b09 | Return the number of non-overlapping occurrences of substring *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation.
If *sub* is empty, returns the number of empty strings between characters
which is the length of the string plus one. For example:: | trusted_official_docs | CPython Docs | Return the number of non-overlapping occurrences of substring *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation.
If *sub* is empty, returns the number of empty strings between characters
which is the length of the string plus one. For example:: | Return the number of non-overlapping occurrences of substring *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation.
If *sub* is empty, returns the number of empty strings between characters
which is the length of the string plus one. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bffa9480-2690-4675-80ce-f06656bfff8a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,918 | supabase-export-v2 | 6c6ae714bc9a5b40 | .. index:: pair: object; tuple
Tuples are immutable sequences, typically used to store collections of
heterogeneous data (such as the 2-tuples produced by the :func:`enumerate`
built-in). Tuples are also used for cases where an immutable sequence of
homogeneous data is needed (such as allowing storage in a :class:`set`... | trusted_official_docs | CPython Docs | .. index:: pair: object; tuple
Tuples are immutable sequences, typically used to store collections of
heterogeneous data (such as the 2-tuples produced by the :func:`enumerate`
built-in). Tuples are also used for cases where an immutable sequence of
homogeneous data is needed (such as allowing storage in a :class:`set`... | .. index:: pair: object; tuple
Tuples are immutable sequences, typically used to store collections of
heterogeneous data (such as the 2-tuples produced by the :func:`enumerate`
built-in). Tuples are also used for cases where an immutable sequence of
homogeneous data is needed (such as allowing storage in a :class:`set`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c0b09f81-fc06-4919-a068-a04735f6705f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,801 | supabase-export-v2 | c02bd90d2863e081 | .. index:: single: iterator protocol single: protocol; iterator single: sequence; iteration single: container; iteration over
Python supports a concept of iteration over containers. This is implemented
using two distinct methods; these are used to allow user-defined classes to
support iteration. Sequences, described be... | trusted_official_docs | CPython Docs | .. index:: single: iterator protocol single: protocol; iterator single: sequence; iteration single: container; iteration over
Python supports a concept of iteration over containers. This is implemented
using two distinct methods; these are used to allow user-defined classes to
support iteration. Sequences, described be... | .. index:: single: iterator protocol single: protocol; iterator single: sequence; iteration single: container; iteration over
Python supports a concept of iteration over containers. This is implemented
using two distinct methods; these are used to allow user-defined classes to
support iteration. Sequences, described be... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c0b6fd24-d0ab-4f75-9f15-4302637d8545 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,359 | supabase-export-v2 | 232ffa60d1c25521 | a zero-filled instance with a given length: ``bytearray(10)`` * From an iterable of integers: ``bytearray(range(20))`` * Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``
As bytearray objects are mutable, they support the
:ref:`mutable <typesseq-mutable>` sequence operations in addition to th... | trusted_official_docs | CPython Docs | a zero-filled instance with a given length: ``bytearray(10)`` * From an iterable of integers: ``bytearray(range(20))`` * Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``
As bytearray objects are mutable, they support the
:ref:`mutable <typesseq-mutable>` sequence operations in addition to th... | a zero-filled instance with a given length: ``bytearray(10)`` * From an iterable of integers: ``bytearray(range(20))`` * Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``
As bytearray objects are mutable, they support the
:ref:`mutable <typesseq-mutable>` sequence operations in addition to th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c0efb10e-8b5e-4c50-a00e-024f217d84c7 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,921 | supabase-export-v2 | deef8b7e1e32c6c8 | Tuples may be constructed in a number of ways:
* Using a pair of parentheses to denote the empty tuple: ``()``
* Using a trailing comma for a 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)`` | trusted_official_docs | CPython Docs | Tuples may be constructed in a number of ways:
* Using a pair of parentheses to denote the empty tuple: ``()``
* Using a trailing comma for a 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)`` | Tuples may be constructed in a number of ways:
* Using a pair of parentheses to denote the empty tuple: ``()``
* Using a trailing comma for a 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)`` | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c12002f2-c0b9-4757-82e5-42a156791d4f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,606 | supabase-export-v2 | c295dfa8d17a4800 | .. method:: bytes.zfill(width, /) bytearray.zfill(width, /)
Return a copy of the sequence left filled with ASCII ``b'0'`` digits to
make a sequence of length *width*. A leading sign prefix (``b'+'``/
``b'-'``) is handled by inserting the padding *after* the sign character
rather than before. For :class:`bytes` objec... | trusted_official_docs | CPython Docs | .. method:: bytes.zfill(width, /) bytearray.zfill(width, /)
Return a copy of the sequence left filled with ASCII ``b'0'`` digits to
make a sequence of length *width*. A leading sign prefix (``b'+'``/
``b'-'``) is handled by inserting the padding *after* the sign character
rather than before. For :class:`bytes` objec... | .. method:: bytes.zfill(width, /) bytearray.zfill(width, /)
Return a copy of the sequence left filled with ASCII ``b'0'`` digits to
make a sequence of length *width*. A leading sign prefix (``b'+'``/
``b'-'``) is handled by inserting the padding *after* the sign character
rather than before. For :class:`bytes` objec... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c1bc4c3e-32e5-46aa-89bf-07e0f650726c | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,656 | supabase-export-v2 | 43a4cf16d69baa1c | number with a zero real part) which you can add to an integer or float to get a complex number with real and imaginary parts.
The constructors :func:`int`, :func:`float`, and
:func:`complex` can be used to produce numbers of a specific type. | trusted_official_docs | CPython Docs | number with a zero real part) which you can add to an integer or float to get a complex number with real and imaginary parts.
The constructors :func:`int`, :func:`float`, and
:func:`complex` can be used to produce numbers of a specific type. | number with a zero real part) which you can add to an integer or float to get a complex number with real and imaginary parts.
The constructors :func:`int`, :func:`float`, and
:func:`complex` can be used to produce numbers of a specific type. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c252740c-45fc-4300-a684-376d2f0b85f9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,997 | supabase-export-v2 | 265821c3613142d3 | .. method:: str.count(sub[, start[, end]])
Return the number of non-overlapping occurrences of substring *sub* in the
range [*start*, *end*]. Optional arguments *start* and *end* are
interpreted as in slice notation. | trusted_official_docs | CPython Docs | .. method:: str.count(sub[, start[, end]])
Return the number of non-overlapping occurrences of substring *sub* in the
range [*start*, *end*]. Optional arguments *start* and *end* are
interpreted as in slice notation. | .. method:: str.count(sub[, start[, end]])
Return the number of non-overlapping occurrences of substring *sub* in the
range [*start*, *end*]. Optional arguments *start* and *end* are
interpreted as in slice notation. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c2819cf7-2291-4fe3-91c7-0fd43f6730ec | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,358 | supabase-export-v2 | 4fcda37971d01d70 | There is no dedicated literal syntax for bytearray objects, instead they are always created by calling the constructor:
* Creating an empty instance: ``bytearray()``
* Creating a zero-filled instance with a given length: ``bytearray(10)``
* From an iterable of integers: ``bytearray(range(20))``
* Copying existing bi... | trusted_official_docs | CPython Docs | There is no dedicated literal syntax for bytearray objects, instead they are always created by calling the constructor:
* Creating an empty instance: ``bytearray()``
* Creating a zero-filled instance with a given length: ``bytearray(10)``
* From an iterable of integers: ``bytearray(range(20))``
* Copying existing bi... | There is no dedicated literal syntax for bytearray objects, instead they are always created by calling the constructor:
* Creating an empty instance: ``bytearray()``
* Creating a zero-filled instance with a given length: ``bytearray(10)``
* From an iterable of integers: ``bytearray(range(20))``
* Copying existing bi... | 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.