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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a19b88c4-d237-432e-aba6-f29a47f5b891 | CPython Docs | file://datasets/cpython/Doc/library/plistlib.rst | unknown | 003bae61-2da3-4160-8821-758134bee2f6 | 22,548 | supabase-export-v2 | 218a9197b1799b6b | a simple serialization supporting basic object types, like dictionaries, lists, numbers and strings. Usually the top level object is a dictionary or a frozen dictionary.
To write out and to parse a plist file, use the :func:`dump` and
:func:`load` functions. | trusted_official_docs | CPython Docs | a simple serialization supporting basic object types, like dictionaries, lists, numbers and strings. Usually the top level object is a dictionary or a frozen dictionary.
To write out and to parse a plist file, use the :func:`dump` and
:func:`load` functions. | a simple serialization supporting basic object types, like dictionaries, lists, numbers and strings. Usually the top level object is a dictionary or a frozen dictionary.
To write out and to parse a plist file, use the :func:`dump` and
:func:`load` functions. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b6ae17c7-781b-44d9-967b-2dde9c6ceacf | CPython Docs | file://datasets/cpython/Doc/library/plistlib.rst | unknown | 003bae61-2da3-4160-8821-758134bee2f6 | 22,564 | supabase-export-v2 | 990f92f56a191b9a | The *dict_type* is the type used for dictionaries that are read from the plist file.
When *aware_datetime* is true, fields with type ``datetime.datetime`` will
be created as :ref:`aware object <datetime-naive-aware>`, with
:attr:`!tzinfo` as :const:`datetime.UTC`. | trusted_official_docs | CPython Docs | The *dict_type* is the type used for dictionaries that are read from the plist file.
When *aware_datetime* is true, fields with type ``datetime.datetime`` will
be created as :ref:`aware object <datetime-naive-aware>`, with
:attr:`!tzinfo` as :const:`datetime.UTC`. | The *dict_type* is the type used for dictionaries that are read from the plist file.
When *aware_datetime* is true, fields with type ``datetime.datetime`` will
be created as :ref:`aware object <datetime-naive-aware>`, with
:attr:`!tzinfo` as :const:`datetime.UTC`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b7d4e412-8506-498c-b130-219e3f6e079a | CPython Docs | file://datasets/cpython/Doc/library/plistlib.rst | unknown | 003bae61-2da3-4160-8821-758134bee2f6 | 22,552 | supabase-export-v2 | 11344b176c8494f3 | .. versionchanged:: 3.4 New API, old API deprecated. Support for binary format plists added.
.. versionchanged:: 3.8
Support added for reading and writing :class:`UID` tokens in binary plists as used
by NSKeyedArchiver and NSKeyedUnarchiver. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.4 New API, old API deprecated. Support for binary format plists added.
.. versionchanged:: 3.8
Support added for reading and writing :class:`UID` tokens in binary plists as used
by NSKeyedArchiver and NSKeyedUnarchiver. | .. versionchanged:: 3.4 New API, old API deprecated. Support for binary format plists added.
.. versionchanged:: 3.8
Support added for reading and writing :class:`UID` tokens in binary plists as used
by NSKeyedArchiver and NSKeyedUnarchiver. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c6855ef7-aa28-4145-b618-6a88221d862b | CPython Docs | file://datasets/cpython/Doc/library/plistlib.rst | unknown | 003bae61-2da3-4160-8821-758134bee2f6 | 22,580 | supabase-export-v2 | 8567e1555383fe40 | When *skipkeys* is false (the default) the function raises :exc:`TypeError` when a key of a dictionary is not a string, otherwise such keys are skipped.
When *aware_datetime* is true and any field with type ``datetime.datetime``
is set as an :ref:`aware object <datetime-naive-aware>`, it will convert to
UTC timezone ... | trusted_official_docs | CPython Docs | When *skipkeys* is false (the default) the function raises :exc:`TypeError` when a key of a dictionary is not a string, otherwise such keys are skipped.
When *aware_datetime* is true and any field with type ``datetime.datetime``
is set as an :ref:`aware object <datetime-naive-aware>`, it will convert to
UTC timezone ... | When *skipkeys* is false (the default) the function raises :exc:`TypeError` when a key of a dictionary is not a string, otherwise such keys are skipped.
When *aware_datetime* is true and any field with type ``datetime.datetime``
is set as an :ref:`aware object <datetime-naive-aware>`, it will convert to
UTC timezone ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ccc6d104-8ecf-4645-940c-574905f2d0d1 | CPython Docs | file://datasets/cpython/Doc/library/plistlib.rst | unknown | 003bae61-2da3-4160-8821-758134bee2f6 | 22,550 | supabase-export-v2 | 1ee6855e4e52b3e2 | To work with plist data in bytes or string objects, use :func:`dumps` and :func:`loads`.
Values can be strings, integers, floats, booleans, tuples, lists, dictionaries
(but only with string keys), :class:`bytes`, :class:`bytearray`
or :class:`datetime.datetime` objects. | trusted_official_docs | CPython Docs | To work with plist data in bytes or string objects, use :func:`dumps` and :func:`loads`.
Values can be strings, integers, floats, booleans, tuples, lists, dictionaries
(but only with string keys), :class:`bytes`, :class:`bytearray`
or :class:`datetime.datetime` objects. | To work with plist data in bytes or string objects, use :func:`dumps` and :func:`loads`.
Values can be strings, integers, floats, booleans, tuples, lists, dictionaries
(but only with string keys), :class:`bytes`, :class:`bytearray`
or :class:`datetime.datetime` objects. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
db249726-c95f-4429-9968-25f8461bb007 | CPython Docs | file://datasets/cpython/Doc/library/plistlib.rst | unknown | 003bae61-2da3-4160-8821-758134bee2f6 | 22,604 | supabase-export-v2 | 5aba2793fabf58b3 | import datetime as dt import plistlib
pl = dict(
aString = "Doodah",
aList = ["A", "B", 12, 32.1, [1, 2, 3]],
aFloat = 0.1,
anInt = 728,
aDict = dict(
anotherString = "<hello & hi there!>",
aThirdString = "M\xe4ssig, Ma\xdf",
aTrueValue = True,
aFalseValue = False,
),
someData = b"<binary gunk>",
someMoreDa... | trusted_official_docs | CPython Docs | import datetime as dt import plistlib
pl = dict(
aString = "Doodah",
aList = ["A", "B", 12, 32.1, [1, 2, 3]],
aFloat = 0.1,
anInt = 728,
aDict = dict(
anotherString = "<hello & hi there!>",
aThirdString = "M\xe4ssig, Ma\xdf",
aTrueValue = True,
aFalseValue = False,
),
someData = b"<binary gunk>",
someMoreDa... | import datetime as dt import plistlib
pl = dict(
aString = "Doodah",
aList = ["A", "B", 12, 32.1, [1, 2, 3]],
aFloat = 0.1,
anInt = 728,
aDict = dict(
anotherString = "<hello & hi there!>",
aThirdString = "M\xe4ssig, Ma\xdf",
aTrueValue = True,
aFalseValue = False,
),
someData = b"<binary gunk>",
someMoreDa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ec87e4d2-a801-4490-9da4-a5690e2254a5 | CPython Docs | file://datasets/cpython/Doc/library/plistlib.rst | unknown | 003bae61-2da3-4160-8821-758134bee2f6 | 22,578 | supabase-export-v2 | 17f7b77119899ff3 | * :data:`FMT_BINARY`: Binary formatted plist file
When *sort_keys* is true (the default) the keys for dictionaries will be
written to the plist in sorted order, otherwise they will be written in
the iteration order of the dictionary. | trusted_official_docs | CPython Docs | * :data:`FMT_BINARY`: Binary formatted plist file
When *sort_keys* is true (the default) the keys for dictionaries will be
written to the plist in sorted order, otherwise they will be written in
the iteration order of the dictionary. | * :data:`FMT_BINARY`: Binary formatted plist file
When *sort_keys* is true (the default) the keys for dictionaries will be
written to the plist in sorted order, otherwise they will be written in
the iteration order of the dictionary. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f6c9c4df-336b-404c-aa62-e425fa461566 | CPython Docs | file://datasets/cpython/Doc/library/plistlib.rst | unknown | 003bae61-2da3-4160-8821-758134bee2f6 | 22,559 | supabase-export-v2 | 719c574d0bc29a2c | Read a plist file. *fp* should be a readable and binary file object. Return the unpacked root object (which usually is a dictionary).
The *fmt* is the format of the file and the following values are valid: | trusted_official_docs | CPython Docs | Read a plist file. *fp* should be a readable and binary file object. Return the unpacked root object (which usually is a dictionary).
The *fmt* is the format of the file and the following values are valid: | Read a plist file. *fp* should be a readable and binary file object. Return the unpacked root object (which usually is a dictionary).
The *fmt* is the format of the file and the following values are valid: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fb420a18-d226-485a-a352-12399f9b59cf | CPython Docs | file://datasets/cpython/Doc/library/plistlib.rst | unknown | 003bae61-2da3-4160-8821-758134bee2f6 | 22,565 | supabase-export-v2 | 58c5c626a859675c | When *aware_datetime* is true, fields with type ``datetime.datetime`` will be created as :ref:`aware object <datetime-naive-aware>`, with :attr:`!tzinfo` as :const:`datetime.UTC`.
XML data for the :data:`FMT_XML` format is parsed using the Expat parser
from :mod:`xml.parsers.expat` -- see its documentation for possibl... | trusted_official_docs | CPython Docs | When *aware_datetime* is true, fields with type ``datetime.datetime`` will be created as :ref:`aware object <datetime-naive-aware>`, with :attr:`!tzinfo` as :const:`datetime.UTC`.
XML data for the :data:`FMT_XML` format is parsed using the Expat parser
from :mod:`xml.parsers.expat` -- see its documentation for possibl... | When *aware_datetime* is true, fields with type ``datetime.datetime`` will be created as :ref:`aware object <datetime-naive-aware>`, with :attr:`!tzinfo` as :const:`datetime.UTC`.
XML data for the :data:`FMT_XML` format is parsed using the Expat parser
from :mod:`xml.parsers.expat` -- see its documentation for possibl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
00ad32da-f9fa-4a35-ac58-bc5934056c2e | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,778 | supabase-export-v2 | 9c0301ac25ee57e0 | 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``.
- The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf``
are used as hash values for positive
infinity or negative infinity (respectively). | trusted_official_docs | CPython Docs | 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``.
- The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf``
are used as hash values for positive
infinity or negative infinity (respectively). | 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``.
- The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf``
are used as hash values for positive
infinity or negative infinity (respectively). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
013238e5-90ee-4a64-bcab-a2027a7fa52d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,405 | supabase-export-v2 | 6f425c022871f031 | .. method:: bytes.count(sub[, start[, end]]) bytearray.count(sub[, start[, end]])
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. | trusted_official_docs | CPython Docs | .. method:: bytes.count(sub[, start[, end]]) bytearray.count(sub[, start[, end]])
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. | .. method:: bytes.count(sub[, start[, end]]) bytearray.count(sub[, start[, end]])
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0168b00b-9215-460b-ba28-adb158632f9e | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,347 | supabase-export-v2 | 6b027a0d5e2efecb | between each byte. A second optional *bytes_per_sep* parameter controls the spacing. Positive values calculate the separator position from the right, negative values from the left.
>>> value = b'\xf0\xf1\xf2'
>>> value.hex('-')
'f0-f1-f2'
>>> value.hex('_', 2)
'f0_f1f2'
>>> b'UUDDLRLRAB'.hex(' ', -4)
'55554444 4c... | trusted_official_docs | CPython Docs | between each byte. A second optional *bytes_per_sep* parameter controls the spacing. Positive values calculate the separator position from the right, negative values from the left.
>>> value = b'\xf0\xf1\xf2'
>>> value.hex('-')
'f0-f1-f2'
>>> value.hex('_', 2)
'f0_f1f2'
>>> b'UUDDLRLRAB'.hex(' ', -4)
'55554444 4c... | between each byte. A second optional *bytes_per_sep* parameter controls the spacing. Positive values calculate the separator position from the right, negative values from the left.
>>> value = b'\xf0\xf1\xf2'
>>> value.hex('-')
'f0-f1-f2'
>>> value.hex('_', 2)
'f0_f1f2'
>>> b'UUDDLRLRAB'.hex(' ', -4)
'55554444 4c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
01b2d076-4bf8-4170-9828-e877738f40ea | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,283 | supabase-export-v2 | 008fd2e1fc1f64c6 | *values* must be a tuple with exactly the number of items specified by the format string, 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 | *values* must be a tuple with exactly the number of items specified by the format string, 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 | *values* must be a tuple with exactly the number of items specified by the format string, 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 | |
01e45a14-d416-4457-8573-3bab4be25c03 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,312 | supabase-export-v2 | ba6143b7ee6750af | (4) The alternate form causes the result to always contain a decimal point, and trailing zeroes are not removed as they would otherwise be.
The precision determines the number of significant digits before and after the
decimal point and defaults to 6. | trusted_official_docs | CPython Docs | (4) The alternate form causes the result to always contain a decimal point, and trailing zeroes are not removed as they would otherwise be.
The precision determines the number of significant digits before and after the
decimal point and defaults to 6. | (4) The alternate form causes the result to always contain a decimal point, and trailing zeroes are not removed as they would otherwise be.
The precision determines the number of significant digits before and after the
decimal point and defaults to 6. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
02026965-9659-445b-9f61-2d3e998eb475 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,108 | supabase-export-v2 | 63defa1c1c4d77b8 | See :meth:`str.removeprefix` for a method that will remove a single prefix string rather than all of a set of characters. For example::
>>> 'Arthur: three!'.lstrip('Arthur: ')
'ee!'
>>> 'Arthur: three!'.removeprefix('Arthur: ')
'three!' | trusted_official_docs | CPython Docs | See :meth:`str.removeprefix` for a method that will remove a single prefix string rather than all of a set of characters. For example::
>>> 'Arthur: three!'.lstrip('Arthur: ')
'ee!'
>>> 'Arthur: three!'.removeprefix('Arthur: ')
'three!' | See :meth:`str.removeprefix` for a method that will remove a single prefix string rather than all of a set of characters. For example::
>>> 'Arthur: three!'.lstrip('Arthur: ')
'ee!'
>>> 'Arthur: three!'.removeprefix('Arthur: ')
'three!' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
03743650-3cc2-4262-9a8a-3fe837b65a15 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,390 | supabase-export-v2 | 7187b6bcf21bcfa5 | See the :ref:`What's New <whatsnew315-bytearray-take-bytes>` entry for common code patterns which can be optimized with :meth:`bytearray.take_bytes`.
Since bytearray objects are sequences of integers (akin to a list), for a
bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be
a bytearray object o... | trusted_official_docs | CPython Docs | See the :ref:`What's New <whatsnew315-bytearray-take-bytes>` entry for common code patterns which can be optimized with :meth:`bytearray.take_bytes`.
Since bytearray objects are sequences of integers (akin to a list), for a
bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be
a bytearray object o... | See the :ref:`What's New <whatsnew315-bytearray-take-bytes>` entry for common code patterns which can be optimized with :meth:`bytearray.take_bytes`.
Since bytearray objects are sequences of integers (akin to a list), for a
bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be
a bytearray object o... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
03fc5b35-5107-490c-9ec9-bd0a0e8cdd99 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,500 | supabase-export-v2 | 149cf4ac761a0e9b | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.rsplit(sep=None, maxsplit=-1)
bytearray.rsplit(sep=None, maxsplit=-1) | trusted_official_docs | CPython Docs | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.rsplit(sep=None, maxsplit=-1)
bytearray.rsplit(sep=None, maxsplit=-1) | The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made.
.. method:: bytes.rsplit(sep=None, maxsplit=-1)
bytearray.rsplit(sep=None, maxsplit=-1) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
04047507-76c3-48d2-b2e8-6a4377ff09b7 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,476 | supabase-export-v2 | fa3e81ee7e045c5b | argument *delete* are removed, and the remaining bytes have been mapped through the given translation table, which must be a bytes object of length 256.
You can use the :func:`bytes.maketrans` method to create a translation
table. | trusted_official_docs | CPython Docs | argument *delete* are removed, and the remaining bytes have been mapped through the given translation table, which must be a bytes object of length 256.
You can use the :func:`bytes.maketrans` method to create a translation
table. | argument *delete* are removed, and the remaining bytes have been mapped through the given translation table, which must be a bytes object of length 256.
You can use the :func:`bytes.maketrans` method to create a translation
table. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0444c425-a0a7-4a15-8764-6af4d72d5dc2 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,237 | supabase-export-v2 | 4422415ce1307e5e | See also :meth:`rjust`.
.. index::
single: ! formatted string literal
single: formatted string literals
single: ! f-string
single: f-strings
single: fstring
single: interpolated string literal
single: string; formatted literal
single: string; interpolated literal
single: {} (curly brackets); in formatted strin... | trusted_official_docs | CPython Docs | See also :meth:`rjust`.
.. index::
single: ! formatted string literal
single: formatted string literals
single: ! f-string
single: f-strings
single: fstring
single: interpolated string literal
single: string; formatted literal
single: string; interpolated literal
single: {} (curly brackets); in formatted strin... | See also :meth:`rjust`.
.. index::
single: ! formatted string literal
single: formatted string literals
single: ! f-string
single: f-strings
single: fstring
single: interpolated string literal
single: string; formatted literal
single: string; interpolated literal
single: {} (curly brackets); in formatted strin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
056b4f1a-b5cf-4c7e-bf65-bf7f5a3faf60 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,840 | supabase-export-v2 | c2d8b2dc1c99b785 | The slice of *s* from *i* to *j* is defined as the sequence of items with index *k* such that ``i <= k < j``.
* If *i* is omitted or ``None``, use ``0``. * If *j* is omitted or ``None``, use ``len(s)``. * If *i* or *j* is less than ``-len(s)``, use ``0``. * If *i* or *j* is greater than ``len(s)``, use ``len(s)``. * If... | trusted_official_docs | CPython Docs | The slice of *s* from *i* to *j* is defined as the sequence of items with index *k* such that ``i <= k < j``.
* If *i* is omitted or ``None``, use ``0``. * If *j* is omitted or ``None``, use ``len(s)``. * If *i* or *j* is less than ``-len(s)``, use ``0``. * If *i* or *j* is greater than ``len(s)``, use ``len(s)``. * If... | The slice of *s* from *i* to *j* is defined as the sequence of items with index *k* such that ``i <= k < j``.
* If *i* is omitted or ``None``, use ``0``. * If *j* is omitted or ``None``, use ``len(s)``. * If *i* or *j* is less than ``-len(s)``, use ``0``. * If *i* or *j* is greater than ``len(s)``, use ``len(s)``. * If... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
06258b9f-a0df-4f08-a796-9c7244574492 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,659 | supabase-export-v2 | f4d2c3833df17816 | .. _stdtypes-mixed-arithmetic:
Python fully supports mixed arithmetic: when a binary arithmetic operator has
operands of different built-in numeric types, the operand with the "narrower"
type is widened to that of the other: | trusted_official_docs | CPython Docs | .. _stdtypes-mixed-arithmetic:
Python fully supports mixed arithmetic: when a binary arithmetic operator has
operands of different built-in numeric types, the operand with the "narrower"
type is widened to that of the other: | .. _stdtypes-mixed-arithmetic:
Python fully supports mixed arithmetic: when a binary arithmetic operator has
operands of different built-in numeric types, the operand with the "narrower"
type is widened to that of the other: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0702f234-1b18-45a6-b57f-7f5eec842cdf | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,891 | supabase-export-v2 | ded2c8f72f126c5c | Retrieve the item at *index* and also removes it from *sequence*. By default, the last item in *sequence* is removed and returned.
.. method:: bytearray.remove(value, /)
list.remove(value, /)
:no-contents-entry:
:no-index-entry:
:no-typesetting:
.. method:: sequence.remove(value, /) | trusted_official_docs | CPython Docs | Retrieve the item at *index* and also removes it from *sequence*. By default, the last item in *sequence* is removed and returned.
.. method:: bytearray.remove(value, /)
list.remove(value, /)
:no-contents-entry:
:no-index-entry:
:no-typesetting:
.. method:: sequence.remove(value, /) | Retrieve the item at *index* and also removes it from *sequence*. By default, the last item in *sequence* is removed and returned.
.. method:: bytearray.remove(value, /)
list.remove(value, /)
:no-contents-entry:
:no-index-entry:
:no-typesetting:
.. method:: sequence.remove(value, /) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
074bb322-74f5-4dd8-af53-58c27b64d0d0 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,868 | supabase-export-v2 | 004ba157197624a9 | table are defined on mutable sequence types. The :class:`collections.abc.MutableSequence` ABC is provided to make it easier to correctly implement these operations on custom sequence types.
In the table *s* is an instance of a mutable sequence type, *t* is any
iterable object and *x* is an arbitrary object that meets a... | trusted_official_docs | CPython Docs | table are defined on mutable sequence types. The :class:`collections.abc.MutableSequence` ABC is provided to make it easier to correctly implement these operations on custom sequence types.
In the table *s* is an instance of a mutable sequence type, *t* is any
iterable object and *x* is an arbitrary object that meets a... | table are defined on mutable sequence types. The :class:`collections.abc.MutableSequence` ABC is provided to make it easier to correctly implement these operations on custom sequence types.
In the table *s* is an instance of a mutable sequence type, *t* is any
iterable object and *x* is an arbitrary object that meets a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
07aa211d-2ef1-48bb-99a1-e00d742cbae6 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,713 | supabase-export-v2 | 777c5e5602d97d34 | Cast 1D/long to 1D/unsigned bytes::
>>> import array
>>> a = array.array('l', [1,2,3])
>>> x = memoryview(a)
>>> x.format
'l'
>>> 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 | trusted_official_docs | CPython Docs | Cast 1D/long to 1D/unsigned bytes::
>>> import array
>>> a = array.array('l', [1,2,3])
>>> x = memoryview(a)
>>> x.format
'l'
>>> 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/long to 1D/unsigned bytes::
>>> import array
>>> a = array.array('l', [1,2,3])
>>> x = memoryview(a)
>>> x.format
'l'
>>> 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 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
08099b0c-c28d-4ab0-b29f-b004e73ec139 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,665 | supabase-export-v2 | b95fb59abaa3ea04 | >>> v = memoryview(b'abcefg') >>> v[1] 98 >>> v[-1] 103 >>> v[1:4] <memory at 0x7f3ddc9f4350> >>> bytes(v[1:4]) b'bce'
If :class:`~memoryview.format` is one of the native format specifiers
from the :mod:`struct` module, indexing with an integer or a tuple of
integers is also supported and returns a single *element* w... | trusted_official_docs | CPython Docs | >>> v = memoryview(b'abcefg') >>> v[1] 98 >>> v[-1] 103 >>> v[1:4] <memory at 0x7f3ddc9f4350> >>> bytes(v[1:4]) b'bce'
If :class:`~memoryview.format` is one of the native format specifiers
from the :mod:`struct` module, indexing with an integer or a tuple of
integers is also supported and returns a single *element* w... | >>> v = memoryview(b'abcefg') >>> v[1] 98 >>> v[-1] 103 >>> v[1:4] <memory at 0x7f3ddc9f4350> >>> bytes(v[1:4]) b'bce'
If :class:`~memoryview.format` is one of the native format specifiers
from the :mod:`struct` module, indexing with an integer or a tuple of
integers is also supported and returns a single *element* w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
08600bb6-cd8a-414d-afc7-45f67b9bc5ca | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,967 | supabase-export-v2 | 50c36b6dc0e2baa0 | There is also no mutable string type, but :meth:`str.join` or :class:`io.StringIO` can be used to efficiently construct strings from multiple fragments.
.. versionchanged:: 3.3
For backwards compatibility with the Python 2 series, the ``u`` prefix is
once again permitted on string literals. It has no effect on the me... | trusted_official_docs | CPython Docs | There is also no mutable string type, but :meth:`str.join` or :class:`io.StringIO` can be used to efficiently construct strings from multiple fragments.
.. versionchanged:: 3.3
For backwards compatibility with the Python 2 series, the ``u`` prefix is
once again permitted on string literals. It has no effect on the me... | There is also no mutable string type, but :meth:`str.join` or :class:`io.StringIO` can be used to efficiently construct strings from multiple fragments.
.. versionchanged:: 3.3
For backwards compatibility with the Python 2 series, the ``u`` prefix is
once again permitted on string literals. It has no effect on the me... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0a0e8aca-7721-42f8-ac39-0795d76b9fb1 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,168 | supabase-export-v2 | 77e1f4dc6e05091f | most ``maxsplit+1`` elements). If *maxsplit* is not specified or ``-1``, then there is no limit on the number of splits (all possible splits are made).
If *sep* is given, consecutive delimiters are not grouped together and are
deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns
``['1', '', '2'... | trusted_official_docs | CPython Docs | most ``maxsplit+1`` elements). If *maxsplit* is not specified or ``-1``, then there is no limit on the number of splits (all possible splits are made).
If *sep* is given, consecutive delimiters are not grouped together and are
deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns
``['1', '', '2'... | most ``maxsplit+1`` elements). If *maxsplit* is not specified or ``-1``, then there is no limit on the number of splits (all possible splits are made).
If *sep* is given, consecutive delimiters are not grouped together and are
deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns
``['1', '', '2'... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c5070b3-7c76-44bc-807e-4566b6b77e2c | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,776 | supabase-export-v2 | ec0e73b27d42fd1f | ``n`` is not divisible by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, P)`` gives the inverse of ``n`` modulo ``P``.
- If ``x = m / n`` is a nonnegative rational number and ``n`` is
divisible by ``P`` (but ``m`` is not) then ``n`` has no inverse
modulo ``P`` and the rule above doesn't appl... | trusted_official_docs | CPython Docs | ``n`` is not divisible by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, P)`` gives the inverse of ``n`` modulo ``P``.
- If ``x = m / n`` is a nonnegative rational number and ``n`` is
divisible by ``P`` (but ``m`` is not) then ``n`` has no inverse
modulo ``P`` and the rule above doesn't appl... | ``n`` is not divisible by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, P)`` gives the inverse of ``n`` modulo ``P``.
- If ``x = m / n`` is a nonnegative rational number and ``n`` is
divisible by ``P`` (but ``m`` is not) then ``n`` has no inverse
modulo ``P`` and the rule above doesn't appl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c5497c1-5037-4a53-8a6d-2d55c1f39fdd | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,004 | supabase-export-v2 | 04e63e82b414e26c | default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and any other name registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details.
For performance reasons, the value of *errors* is not checke... | trusted_official_docs | CPython Docs | default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and any other name registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details.
For performance reasons, the value of *errors* is not checke... | default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and any other name registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details.
For performance reasons, the value of *errors* is not checke... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c9917a7-9e06-4b51-94ca-c43ed09519ce | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,703 | supabase-export-v2 | 543f10c23e78198c | .. method:: release()
Release the underlying buffer exposed by the memoryview object. Many
objects take special actions when a view is held on them (for example,
a :class:`bytearray` would temporarily forbid resizing); therefore,
calling release() is handy to remove these restrictions (and free any
dangling resourc... | trusted_official_docs | CPython Docs | .. method:: release()
Release the underlying buffer exposed by the memoryview object. Many
objects take special actions when a view is held on them (for example,
a :class:`bytearray` would temporarily forbid resizing); therefore,
calling release() is handy to remove these restrictions (and free any
dangling resourc... | .. method:: release()
Release the underlying buffer exposed by the memoryview object. Many
objects take special actions when a view is held on them (for example,
a :class:`bytearray` would temporarily forbid resizing); therefore,
calling release() is handy to remove these restrictions (and free any
dangling resourc... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c9ecf9a-b5b2-414b-9917-173b9907f4ff | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,900 | supabase-export-v2 | 70e44e9b4562bc8e | Lists may be constructed in several ways:
* Using a pair of square brackets to denote the empty list: ``[]``
* Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``
* Using a list comprehension: ``[x for x in iterable]``
* Using the type constructor: ``list()`` or ``list(iterable)`` | trusted_official_docs | CPython Docs | Lists may be constructed in several ways:
* Using a pair of square brackets to denote the empty list: ``[]``
* Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``
* Using a list comprehension: ``[x for x in iterable]``
* Using the type constructor: ``list()`` or ``list(iterable)`` | Lists may be constructed in several ways:
* Using a pair of square brackets to denote the empty list: ``[]``
* Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``
* Using a list comprehension: ``[x for x in iterable]``
* Using the type constructor: ``list()`` or ``list(iterable)`` | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0ceb465a-cd3d-4d7f-81e5-1643ce45164d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,231 | supabase-export-v2 | 1772e9291b6796c0 | ``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, titlecase).
The uppercasing algorithm used is `described in section 3.13.2 'Default Case
Conversion' of the Unicode Standard
<https://www.unicode.org/versions... | trusted_official_docs | CPython Docs | ``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, titlecase).
The uppercasing algorithm used is `described in section 3.13.2 'Default Case
Conversion' of the Unicode Standard
<https://www.unicode.org/versions... | ``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, titlecase).
The uppercasing algorithm used is `described in section 3.13.2 'Default Case
Conversion' of the Unicode Standard
<https://www.unicode.org/versions... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0d137c54-5d4a-49ce-87d6-103c32f25e26 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,655 | supabase-export-v2 | 3796a21967ec8c7f | .. index:: pair: numeric; literals pair: integer; literals pair: floating-point; literals pair: complex number; literals pair: hexadecimal; literals pair: octal; literals pair: binary; literals
Numbers are created by numeric literals or as the result of built-in functions
and operators. Unadorned integer literals (incl... | trusted_official_docs | CPython Docs | .. index:: pair: numeric; literals pair: integer; literals pair: floating-point; literals pair: complex number; literals pair: hexadecimal; literals pair: octal; literals pair: binary; literals
Numbers are created by numeric literals or as the result of built-in functions
and operators. Unadorned integer literals (incl... | .. index:: pair: numeric; literals pair: integer; literals pair: floating-point; literals pair: complex number; literals pair: hexadecimal; literals pair: octal; literals pair: binary; literals
Numbers are created by numeric literals or as the result of built-in functions
and operators. Unadorned integer literals (incl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0ecd2dce-6caf-489f-8e27-9ff7bfb59ece | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,640 | supabase-export-v2 | 13db961c5370e3ce | that *y* is evaluated only once (but in both cases *z* is not evaluated at all when ``x < y`` is found to be false).
This table summarizes the comparison operations: | trusted_official_docs | CPython Docs | that *y* is evaluated only once (but in both cases *z* is not evaluated at all when ``x < y`` is found to be false).
This table summarizes the comparison operations: | that *y* is evaluated only once (but in both cases *z* is not evaluated at all when ``x < y`` is found to be false).
This table summarizes the comparison operations: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0ed05b43-577a-444b-ba39-229f93316b47 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,301 | supabase-export-v2 | c6bcad98221fc068 | The conversion types are:
+------------+-----------------------------------------------------+-------+
| Conversion | Meaning | Notes |
+============+=====================================================+=======+
| ``'d'`` | Signed integer decimal. | |
+------------+-----------------------------------------------------... | trusted_official_docs | CPython Docs | The conversion types are:
+------------+-----------------------------------------------------+-------+
| Conversion | Meaning | Notes |
+============+=====================================================+=======+
| ``'d'`` | Signed integer decimal. | |
+------------+-----------------------------------------------------... | The conversion types are:
+------------+-----------------------------------------------------+-------+
| Conversion | Meaning | Notes |
+============+=====================================================+=======+
| ``'d'`` | Signed integer decimal. | |
+------------+-----------------------------------------------------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0f5891ae-32e0-4485-9b5d-43e5f3823924 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,672 | supabase-export-v2 | 1caf5fb4765debe0 | >>> v = memoryview(b'abcefg') >>> hash(v) == hash(b'abcefg') True >>> hash(v[2:4]) == hash(b'ce') True >>> hash(v[::-2]) == hash(b'abcefg'[::-2]) True
.. versionchanged:: 3.3
One-dimensional memoryviews can now be sliced. One-dimensional memoryviews with formats 'B', 'b' or 'c' are now :term:`hashable`. | trusted_official_docs | CPython Docs | >>> v = memoryview(b'abcefg') >>> hash(v) == hash(b'abcefg') True >>> hash(v[2:4]) == hash(b'ce') True >>> hash(v[::-2]) == hash(b'abcefg'[::-2]) True
.. versionchanged:: 3.3
One-dimensional memoryviews can now be sliced. One-dimensional memoryviews with formats 'B', 'b' or 'c' are now :term:`hashable`. | >>> v = memoryview(b'abcefg') >>> hash(v) == hash(b'abcefg') True >>> hash(v[2:4]) == hash(b'ce') True >>> hash(v[::-2]) == hash(b'abcefg'[::-2]) True
.. versionchanged:: 3.3
One-dimensional memoryviews can now be sliced. One-dimensional memoryviews with formats 'B', 'b' or 'c' are now :term:`hashable`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
10581d4d-ba00-494c-ab35-bbc8f79f6922 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,449 | supabase-export-v2 | 50b2d44b1bb4e00c | .. staticmethod:: bytes.maketrans(from, to, /) bytearray.maketrans(from, to, /)
This static method returns a translation table usable for
:meth:`bytes.translate` that will map each character in *from* into the
character at the same position in *to*; *from* and *to* must both be
:term:`bytes-like objects <bytes-like ... | trusted_official_docs | CPython Docs | .. staticmethod:: bytes.maketrans(from, to, /) bytearray.maketrans(from, to, /)
This static method returns a translation table usable for
:meth:`bytes.translate` that will map each character in *from* into the
character at the same position in *to*; *from* and *to* must both be
:term:`bytes-like objects <bytes-like ... | .. staticmethod:: bytes.maketrans(from, to, /) bytearray.maketrans(from, to, /)
This static method returns a translation table usable for
:meth:`bytes.translate` that will map each character in *from* into the
character at the same position in *to*; *from* and *to* must both be
:term:`bytes-like objects <bytes-like ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
10e81d82-3383-4c45-a1ca-1deb640de571 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,182 | supabase-export-v2 | b8693e0e69472415 | This method splits on the following line boundaries. In particular, the boundaries are a superset of :term:`universal newlines`.
+-----------------------+-----------------------------+
| Representation | Description |
+=======================+=============================+
| ``\n`` | Line Feed |
+------------------... | trusted_official_docs | CPython Docs | This method splits on the following line boundaries. In particular, the boundaries are a superset of :term:`universal newlines`.
+-----------------------+-----------------------------+
| Representation | Description |
+=======================+=============================+
| ``\n`` | Line Feed |
+------------------... | This method splits on the following line boundaries. In particular, the boundaries are a superset of :term:`universal newlines`.
+-----------------------+-----------------------------+
| Representation | Description |
+=======================+=============================+
| ``\n`` | Line Feed |
+------------------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11182062-48dc-4084-b2b0-4e825115f10a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,716 | supabase-export-v2 | 5709cc1e19d98f94 | b'a' Traceback (most recent call last): ... TypeError: memoryview: invalid type for format 'B' >>> y = x.cast('c') >>> y[0] = b'a' >>> b bytearray(b'ayz')
Cast 1D/bytes to 3D/ints to 1D/signed char:: | trusted_official_docs | CPython Docs | b'a' Traceback (most recent call last): ... TypeError: memoryview: invalid type for format 'B' >>> y = x.cast('c') >>> y[0] = b'a' >>> b bytearray(b'ayz')
Cast 1D/bytes to 3D/ints to 1D/signed char:: | b'a' Traceback (most recent call last): ... TypeError: memoryview: invalid type for format 'B' >>> y = x.cast('c') >>> y[0] = b'a' >>> b bytearray(b'ayz')
Cast 1D/bytes to 3D/ints to 1D/signed char:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11767e7e-8868-4738-98e4-4520d0d256af | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,945 | supabase-export-v2 | 6db441ce1f7969d3 | Range objects implement the :class:`collections.abc.Sequence` ABC, and provide features such as containment tests, element index lookup, slicing and support for negative indices (see :ref:`typesseq`):
>>> r = range(0, 20, 2)
>>> r
range(0, 20, 2)
>>> 11 in r
False
>>> 10 in r
True
>>> r.index(10)
5
>>> r[5]
1... | trusted_official_docs | CPython Docs | Range objects implement the :class:`collections.abc.Sequence` ABC, and provide features such as containment tests, element index lookup, slicing and support for negative indices (see :ref:`typesseq`):
>>> r = range(0, 20, 2)
>>> r
range(0, 20, 2)
>>> 11 in r
False
>>> 10 in r
True
>>> r.index(10)
5
>>> r[5]
1... | Range objects implement the :class:`collections.abc.Sequence` ABC, and provide features such as containment tests, element index lookup, slicing and support for negative indices (see :ref:`typesseq`):
>>> r = range(0, 20, 2)
>>> r
range(0, 20, 2)
>>> 11 in r
False
>>> 10 in r
True
>>> r.index(10)
5
>>> r[5]
1... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
119912b9-85fd-4e1c-86b4-670d121b21c5 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,284 | supabase-export-v2 | a371842c95265d89 | .. index:: single: () (parentheses); in printf-style formatting single: * (asterisk); in printf-style formatting single: . (dot); in printf-style formatting
A conversion specifier contains two or more characters and has the following
components, which must occur in this order: | trusted_official_docs | CPython Docs | .. index:: single: () (parentheses); in printf-style formatting single: * (asterisk); in printf-style formatting single: . (dot); in printf-style formatting
A conversion specifier contains two or more characters and has the following
components, which must occur in this order: | .. index:: single: () (parentheses); in printf-style formatting single: * (asterisk); in printf-style formatting single: . (dot); in printf-style formatting
A conversion specifier contains two or more characters and has the following
components, which must occur in this order: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1205ee56-36c7-4647-9559-1ab9fcdcd87e | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,637 | supabase-export-v2 | 902e59f13fda9a6a | | \(1) | +------------+-----------------------------------------------------+-------+ | ``'u'`` | Obsolete type -- it is identical to ``'d'``. | \(8) | +------------+-----------------------------------------------------+-------+ | ``'x'`` | Signed hexadecimal (lowercase).
| \(2) |
+------------+------------------------... | trusted_official_docs | CPython Docs | | \(1) | +------------+-----------------------------------------------------+-------+ | ``'u'`` | Obsolete type -- it is identical to ``'d'``. | \(8) | +------------+-----------------------------------------------------+-------+ | ``'x'`` | Signed hexadecimal (lowercase).
| \(2) |
+------------+------------------------... | | \(1) | +------------+-----------------------------------------------------+-------+ | ``'u'`` | Obsolete type -- it is identical to ``'d'``. | \(8) | +------------+-----------------------------------------------------+-------+ | ``'x'`` | Signed hexadecimal (lowercase).
| \(2) |
+------------+------------------------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
128bcd13-a54f-42c4-a903-719783068f7a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,835 | supabase-export-v2 | 16899f0047eb0fcb | >>> lists = [[]] * 3 >>> lists [[], [], []] >>> lists[0].append(3) >>> lists [[3], [3], [3]]
What has happened is that ``[[]]`` is a one-element list containing an empty
list, so all three elements of ``[[]] * 3`` are references to this single empty
list. Modifying any of the elements of ``lists`` modifies this singl... | trusted_official_docs | CPython Docs | >>> lists = [[]] * 3 >>> lists [[], [], []] >>> lists[0].append(3) >>> lists [[3], [3], [3]]
What has happened is that ``[[]]`` is a one-element list containing an empty
list, so all three elements of ``[[]] * 3`` are references to this single empty
list. Modifying any of the elements of ``lists`` modifies this singl... | >>> lists = [[]] * 3 >>> lists [[], [], []] >>> lists[0].append(3) >>> lists [[3], [3], [3]]
What has happened is that ``[[]]`` is a one-element list containing an empty
list, so all three elements of ``[[]] * 3`` are references to this single empty
list. Modifying any of the elements of ``lists`` modifies this singl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
12ba4185-fc62-4b4c-af71-233d1cbdfbec | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,805 | supabase-export-v2 | 57020dba1180ddde | .. method:: container.__iter__()
Return an :term:`iterator` object. The object is required to support the
iterator protocol described below. If a container supports different types
of iteration, additional methods can be provided to specifically request
iterators for those iteration types. (An example of an object s... | trusted_official_docs | CPython Docs | .. method:: container.__iter__()
Return an :term:`iterator` object. The object is required to support the
iterator protocol described below. If a container supports different types
of iteration, additional methods can be provided to specifically request
iterators for those iteration types. (An example of an object s... | .. method:: container.__iter__()
Return an :term:`iterator` object. The object is required to support the
iterator protocol described below. If a container supports different types
of iteration, additional methods can be provided to specifically request
iterators for those iteration types. (An example of an object s... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
13126bc6-fff6-40cf-92e4-0b79be52e75f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,961 | supabase-export-v2 | ca2fc275259d7f66 | Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal.
String literals that are part of a single expression and have only whitespace
between them will be implicitly converted to a single string literal. That
is, ``("spam " "eggs") == "spam eggs"``. | trusted_official_docs | CPython Docs | Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal.
String literals that are part of a single expression and have only whitespace
between them will be implicitly converted to a single string literal. That
is, ``("spam " "eggs") == "spam eggs"``. | Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal.
String literals that are part of a single expression and have only whitespace
between them will be implicitly converted to a single string literal. That
is, ``("spam " "eggs") == "spam eggs"``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
132f0808-dc6c-435b-bf11-ef81002bb655 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,593 | supabase-export-v2 | 245fc4a502172598 | 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::
>>> b"they're bill's friends from the UK".title()
b"They'Re Bill'S Friends From The Uk" | trusted_official_docs | CPython Docs | 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::
>>> b"they're bill's friends from the UK".title()
b"They'Re Bill'S Friends From The Uk" | 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::
>>> b"they're bill's friends from the UK".title()
b"They'Re Bill'S Friends From The Uk" | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
13f28fb9-99fc-47bf-a31d-84b7502fa6a9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,309 | supabase-export-v2 | 2c0387da0784b985 | alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on whether the ``'x'`` or ``'X'`` format was used) to be inserted before the first digit.
(3)
The alternate form causes the result to always contain a decimal point, even if
no digits follow it. | trusted_official_docs | CPython Docs | alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on whether the ``'x'`` or ``'X'`` format was used) to be inserted before the first digit.
(3)
The alternate form causes the result to always contain a decimal point, even if
no digits follow it. | alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on whether the ``'x'`` or ``'X'`` format was used) to be inserted before the first digit.
(3)
The alternate form causes the result to always contain a decimal point, even if
no digits follow it. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
141db4db-7bbc-4fd7-b0b2-406f259de71e | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,334 | supabase-export-v2 | a2f38524aab8daf8 | In addition to the literal forms, bytes objects can be created in a number of other ways:
* A 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)`` | trusted_official_docs | CPython Docs | In addition to the literal forms, bytes objects can be created in a number of other ways:
* A 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)`` | In addition to the literal forms, bytes objects can be created in a number of other ways:
* A 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)`` | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
144d7e5d-15ab-41fa-a835-b20f8263e002 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,519 | supabase-export-v2 | 99362d88eb2b6d2e | the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a prefix or suffix; rather, all combinations of its values are stripped::
>>> b' spacious '.strip()
b'spacious'
>>> b'www.example.com'.strip(b'cmowz.')
b'example' | trusted_official_docs | CPython Docs | the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a prefix or suffix; rather, all combinations of its values are stripped::
>>> b' spacious '.strip()
b'spacious'
>>> b'www.example.com'.strip(b'cmowz.')
b'example' | the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a prefix or suffix; rather, all combinations of its values are stripped::
>>> b' spacious '.strip()
b'spacious'
>>> b'www.example.com'.strip(b'cmowz.')
b'example' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1528944d-dfd1-4b3d-94c4-9615e9d6b9b2 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,278 | supabase-export-v2 | fed4cbf1912a3305 | operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly).
Using :ref:`formatted string literals <f-strings>`, the :meth:`str.format`
interface, or :class:`string.Template` may help avoid these errors. Each of these alter... | trusted_official_docs | CPython Docs | operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly).
Using :ref:`formatted string literals <f-strings>`, the :meth:`str.format`
interface, or :class:`string.Template` may help avoid these errors. Each of these alter... | operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly).
Using :ref:`formatted string literals <f-strings>`, the :meth:`str.format`
interface, or :class:`string.Template` may help avoid these errors. Each of these alter... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1532377b-ebcb-48ef-a445-a7eb5d24855a | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,911 | supabase-export-v2 | 4c7b594805df75d9 | remind users that it operates by side effect, it does not return the sorted sequence (use :func:`sorted` to explicitly request a new sorted list instance).
The :meth:`sort` method is guaranteed to be stable. A sort is stable if it
guarantees not to change the relative order of elements that compare equal
--- this is ... | trusted_official_docs | CPython Docs | remind users that it operates by side effect, it does not return the sorted sequence (use :func:`sorted` to explicitly request a new sorted list instance).
The :meth:`sort` method is guaranteed to be stable. A sort is stable if it
guarantees not to change the relative order of elements that compare equal
--- this is ... | remind users that it operates by side effect, it does not return the sorted sequence (use :func:`sorted` to explicitly request a new sorted list instance).
The :meth:`sort` method is guaranteed to be stable. A sort is stable if it
guarantees not to change the relative order of elements that compare equal
--- this is ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15aeebb0-ae14-4955-a98f-df887aea3c0d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,995 | supabase-export-v2 | 710b786725e9c1dc | using the specified *fillchar* (default is an ASCII space). The original string is returned if *width* is less than or equal to ``len(s)``. For example::
>>> 'Python'.center(10)
' Python '
>>> 'Python'.center(10, '-')
'--Python--'
>>> 'Python'.center(4)
'Python' | trusted_official_docs | CPython Docs | using the specified *fillchar* (default is an ASCII space). The original string is returned if *width* is less than or equal to ``len(s)``. For example::
>>> 'Python'.center(10)
' Python '
>>> 'Python'.center(10, '-')
'--Python--'
>>> 'Python'.center(4)
'Python' | using the specified *fillchar* (default is an ASCII space). The original string is returned if *width* is less than or equal to ``len(s)``. For example::
>>> 'Python'.center(10)
' Python '
>>> 'Python'.center(10, '-')
'--Python--'
>>> 'Python'.center(4)
'Python' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
16e17862-c89a-4556-a998-4de977ace300 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,974 | supabase-export-v2 | 5c23962223553af9 | :meth:`bytes.decode(encoding, errors) <bytes.decode>`. Otherwise, the bytes object underlying the buffer object is obtained before calling :meth:`bytes.decode`. See :ref:`binaryseq` and :ref:`bufferobjects` for information on buffer objects.
Passing a :class:`bytes` object to :func:`str` without the *encoding*
or *err... | trusted_official_docs | CPython Docs | :meth:`bytes.decode(encoding, errors) <bytes.decode>`. Otherwise, the bytes object underlying the buffer object is obtained before calling :meth:`bytes.decode`. See :ref:`binaryseq` and :ref:`bufferobjects` for information on buffer objects.
Passing a :class:`bytes` object to :func:`str` without the *encoding*
or *err... | :meth:`bytes.decode(encoding, errors) <bytes.decode>`. Otherwise, the bytes object underlying the buffer object is obtained before calling :meth:`bytes.decode`. See :ref:`binaryseq` and :ref:`bufferobjects` for information on buffer objects.
Passing a :class:`bytes` object to :func:`str` without the *encoding*
or *err... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
16f25333-266a-4af8-868e-5efa9aff98a3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,217 | supabase-export-v2 | bd3a4dc1af9dda5d | 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::
>>> "they're bill's friends from the UK".title()
"They'Re Bill'S Friends From The Uk" | trusted_official_docs | CPython Docs | 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::
>>> "they're bill's friends from the UK".title()
"They'Re Bill'S Friends From The Uk" | 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::
>>> "they're bill's friends from the UK".title()
"They'Re Bill'S Friends From The Uk" | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
18e79fa1-76dd-410c-a558-4d531c6dd252 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,331 | supabase-export-v2 | 077f0e9388121d94 | bytes literals (regardless of the declared source code encoding). Any binary values over 127 must be entered into bytes literals using the appropriate escape sequence.
As with string literals, bytes literals may also use a ``r`` prefix to disable
processing of escape sequences. See :ref:`strings` for more about the va... | trusted_official_docs | CPython Docs | bytes literals (regardless of the declared source code encoding). Any binary values over 127 must be entered into bytes literals using the appropriate escape sequence.
As with string literals, bytes literals may also use a ``r`` prefix to disable
processing of escape sequences. See :ref:`strings` for more about the va... | bytes literals (regardless of the declared source code encoding). Any binary values over 127 must be entered into bytes literals using the appropriate escape sequence.
As with string literals, bytes literals may also use a ``r`` prefix to disable
processing of escape sequences. See :ref:`strings` for more about the va... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
190a607a-20da-48bd-940c-5e9cbb8cead3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,112 | supabase-export-v2 | 1c9475d36dd2cfe5 | ordinals (integers) or characters (strings of length 1) to Unicode ordinals, strings (of arbitrary lengths) or ``None``. Character keys will then be converted to ordinals.
If there are two arguments, they must be strings of equal length, and in the
resulting dictionary, each character in *from* will be mapped to the c... | trusted_official_docs | CPython Docs | ordinals (integers) or characters (strings of length 1) to Unicode ordinals, strings (of arbitrary lengths) or ``None``. Character keys will then be converted to ordinals.
If there are two arguments, they must be strings of equal length, and in the
resulting dictionary, each character in *from* will be mapped to the c... | ordinals (integers) or characters (strings of length 1) to Unicode ordinals, strings (of arbitrary lengths) or ``None``. Character keys will then be converted to ordinals.
If there are two arguments, they must be strings of equal length, and in the
resulting dictionary, each character in *from* will be mapped to the c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1a2a5dd0-c041-43e9-b90e-6d3d53c65052 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,727 | supabase-export-v2 | ac4de86626cf4247 | is at the end of the byte array. To request the native byte order of the host system, use :data:`sys.byteorder` as the byte order value.
The *signed* argument indicates whether two's complement is used to
represent the integer. | trusted_official_docs | CPython Docs | is at the end of the byte array. To request the native byte order of the host system, use :data:`sys.byteorder` as the byte order value.
The *signed* argument indicates whether two's complement is used to
represent the integer. | is at the end of the byte array. To request the native byte order of the host system, use :data:`sys.byteorder` as the byte order value.
The *signed* argument indicates whether two's complement is used to
represent the integer. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1a5033bd-aa01-4a5a-8cb1-4f5be4977856 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,080 | supabase-export-v2 | efb046025a8d9084 | >>> ''.isspace() False >>> ' '.isspace() True >>> '\t\n'.isspace() # TAB and BREAK LINE True >>> '\u3000'.isspace() # IDEOGRAPHIC SPACE True
A character is *whitespace* if in the Unicode character database
(see :mod:`unicodedata`), either its general category is ``Zs``
("Separator, space"), or its bidirectional class... | trusted_official_docs | CPython Docs | >>> ''.isspace() False >>> ' '.isspace() True >>> '\t\n'.isspace() # TAB and BREAK LINE True >>> '\u3000'.isspace() # IDEOGRAPHIC SPACE True
A character is *whitespace* if in the Unicode character database
(see :mod:`unicodedata`), either its general category is ``Zs``
("Separator, space"), or its bidirectional class... | >>> ''.isspace() False >>> ' '.isspace() True >>> '\t\n'.isspace() # TAB and BREAK LINE True >>> '\u3000'.isspace() # IDEOGRAPHIC SPACE True
A character is *whitespace* if in the Unicode character database
(see :mod:`unicodedata`), either its general category is ``Zs``
("Separator, space"), or its bidirectional class... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1a8364de-c797-42c3-a0dd-46538311efab | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,994 | supabase-export-v2 | 7c263da5f2dc3d23 | .. method:: str.center(width, fillchar=' ', /)
Return centered 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)``. For example:: | trusted_official_docs | CPython Docs | .. method:: str.center(width, fillchar=' ', /)
Return centered 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)``. For example:: | .. method:: str.center(width, fillchar=' ', /)
Return centered 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)``. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1ad91d7d-2528-457d-9706-8e4151cf9995 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,660 | supabase-export-v2 | c47b41c5ff31f102 | when a binary arithmetic operator has operands of different built-in numeric types, the operand with the "narrower" type is widened to that of the other:
* If both arguments are complex numbers, no conversion is performed;
* if either argument is a complex or a floating-point number, the other is
converted to a floati... | trusted_official_docs | CPython Docs | when a binary arithmetic operator has operands of different built-in numeric types, the operand with the "narrower" type is widened to that of the other:
* If both arguments are complex numbers, no conversion is performed;
* if either argument is a complex or a floating-point number, the other is
converted to a floati... | when a binary arithmetic operator has operands of different built-in numeric types, the operand with the "narrower" type is widened to that of the other:
* If both arguments are complex numbers, no conversion is performed;
* if either argument is a complex or a floating-point number, the other is
converted to a floati... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1bdb9d87-6c24-4d57-be13-e33a0a7cba41 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,687 | supabase-export-v2 | 3a48d2f483f90639 | Return the data in the buffer as a bytestring. This is equivalent to calling the :class:`bytes` constructor on the memoryview. ::
>>> m = memoryview(b"abc")
>>> m.tobytes()
b'abc'
>>> bytes(m)
b'abc' | trusted_official_docs | CPython Docs | Return the data in the buffer as a bytestring. This is equivalent to calling the :class:`bytes` constructor on the memoryview. ::
>>> m = memoryview(b"abc")
>>> m.tobytes()
b'abc'
>>> bytes(m)
b'abc' | Return the data in the buffer as a bytestring. This is equivalent to calling the :class:`bytes` constructor on the memoryview. ::
>>> m = memoryview(b"abc")
>>> m.tobytes()
b'abc'
>>> bytes(m)
b'abc' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1be73af4-7800-4d82-9f6e-86279b786ae1 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,706 | supabase-export-v2 | 3cb8a2a4ab17f2f0 | m = memoryview(b'abc') >>> m.release() >>> m[0] Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: operation forbidden on released memoryview object
The context management protocol can be used for a similar effect,
using the ``with`` statement:: | trusted_official_docs | CPython Docs | m = memoryview(b'abc') >>> m.release() >>> m[0] Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: operation forbidden on released memoryview object
The context management protocol can be used for a similar effect,
using the ``with`` statement:: | m = memoryview(b'abc') >>> m.release() >>> m[0] Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: operation forbidden on released memoryview object
The context management protocol can be used for a similar effect,
using the ``with`` statement:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1bee30e1-1823-48f6-af6e-b4e22fa121f0 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,931 | supabase-export-v2 | a22ac92a17caa82f | *step*, the contents of a range ``r`` are determined by the formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``.
For a negative *step*, the contents of the range are still determined by
the formula ``r[i] = start + step*i``, but the constraints are ``i >= 0``
and ``r[i] > stop``. | trusted_official_docs | CPython Docs | *step*, the contents of a range ``r`` are determined by the formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``.
For a negative *step*, the contents of the range are still determined by
the formula ``r[i] = start + step*i``, but the constraints are ``i >= 0``
and ``r[i] > stop``. | *step*, the contents of a range ``r`` are determined by the formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``.
For a negative *step*, the contents of the range are still determined by
the formula ``r[i] = start + step*i``, but the constraints are ``i >= 0``
and ``r[i] > stop``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1e6f2541-e2a6-4a5a-a6d6-ea36835dbc91 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,466 | supabase-export-v2 | caa89b8fc7ddd518 | Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence *sub* is not found.
The subsequence to search for may be any :term:`bytes-like object` or an
integer in the range 0 to 255. | trusted_official_docs | CPython Docs | Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence *sub* is not found.
The subsequence to search for may be any :term:`bytes-like object` or an
integer in the range 0 to 255. | Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence *sub* is not found.
The subsequence to search for may be any :term:`bytes-like object` or an
integer in the range 0 to 255. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1eedc471-5e67-4f3a-9d86-30a884481bd6 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,052 | supabase-export-v2 | 3d2eb06d70b10f31 | .. method:: str.isdecimal()
Return ``True`` if all characters in the string are decimal
characters and there is at least one character, ``False``
otherwise. Decimal characters are those that can be used to form
numbers in base 10, such as U+0660, ARABIC-INDIC DIGIT
ZERO. Formally a decimal character is a character ... | trusted_official_docs | CPython Docs | .. method:: str.isdecimal()
Return ``True`` if all characters in the string are decimal
characters and there is at least one character, ``False``
otherwise. Decimal characters are those that can be used to form
numbers in base 10, such as U+0660, ARABIC-INDIC DIGIT
ZERO. Formally a decimal character is a character ... | .. method:: str.isdecimal()
Return ``True`` if all characters in the string are decimal
characters and there is at least one character, ``False``
otherwise. Decimal characters are those that can be used to form
numbers in base 10, such as U+0660, ARABIC-INDIC DIGIT
ZERO. Formally a decimal character is a character ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
20f452b1-e47b-4896-ba1e-4133afd9cfcc | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,440 | supabase-export-v2 | 046a07b6ce269fdd | be used only if you need to know the position of *sub*. To check if *sub* is a substring or not, use the :keyword:`in` operator::
>>> b'Py' in b'Python'
True | trusted_official_docs | CPython Docs | be used only if you need to know the position of *sub*. To check if *sub* is a substring or not, use the :keyword:`in` operator::
>>> b'Py' in b'Python'
True | be used only if you need to know the position of *sub*. To check if *sub* is a substring or not, use the :keyword:`in` operator::
>>> b'Py' in b'Python'
True | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
212e0375-63f0-4671-be54-6d91c5e5fd22 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,296 | supabase-export-v2 | 63a282002c6a8f1e | The conversion flag characters are:
.. index::
single: # (hash); in printf-style formatting
single: - (minus); in printf-style formatting
single: + (plus); in printf-style formatting
single: space; in printf-style formatting | trusted_official_docs | CPython Docs | The conversion flag characters are:
.. index::
single: # (hash); in printf-style formatting
single: - (minus); in printf-style formatting
single: + (plus); in printf-style formatting
single: space; in printf-style formatting | The conversion flag characters are:
.. index::
single: # (hash); in printf-style formatting
single: - (minus); in printf-style formatting
single: + (plus); in printf-style formatting
single: space; in printf-style formatting | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
21c4da9d-9d0f-4d92-97b1-fbcb3aba291e | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,705 | supabase-export-v2 | 88766198a6d7dbc5 | After this method has been called, any further operation on the view raises a :class:`ValueError` (except :meth:`release` itself which can be called multiple times)::
>>> m = memoryview(b'abc')
>>> m.release()
>>> m[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: operation for... | trusted_official_docs | CPython Docs | After this method has been called, any further operation on the view raises a :class:`ValueError` (except :meth:`release` itself which can be called multiple times)::
>>> m = memoryview(b'abc')
>>> m.release()
>>> m[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: operation for... | After this method has been called, any further operation on the view raises a :class:`ValueError` (except :meth:`release` itself which can be called multiple times)::
>>> m = memoryview(b'abc')
>>> m.release()
>>> m[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: operation for... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
22733d7a-c48c-4d6b-a938-5d5c7b7d7d83 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,138 | supabase-export-v2 | 5ebf469104c27eee | .. method:: str.rfind(sub[, start[, end]])
Return the highest index in the string where substring *sub* is found, such
that *sub* is contained within ``s[start:end]``. Optional arguments *start*
and *end* are interpreted as in slice notation. Return ``-1`` on failure. For example: | trusted_official_docs | CPython Docs | .. method:: str.rfind(sub[, start[, end]])
Return the highest index in the string where substring *sub* is found, such
that *sub* is contained within ``s[start:end]``. Optional arguments *start*
and *end* are interpreted as in slice notation. Return ``-1`` on failure. For example: | .. method:: str.rfind(sub[, start[, end]])
Return the highest index in the string where substring *sub* is found, such
that *sub* is contained within ``s[start:end]``. Optional arguments *start*
and *end* are interpreted as in slice notation. Return ``-1`` on failure. For example: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
232b4848-9307-4c5d-b461-f233cb3f5c6e | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,434 | supabase-export-v2 | 22a7f333d50fad47 | also be a tuple of suffixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position.
The suffix(es) to search for may be any :term:`bytes-like object`. | trusted_official_docs | CPython Docs | also be a tuple of suffixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position.
The suffix(es) to search for may be any :term:`bytes-like object`. | also be a tuple of suffixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position.
The suffix(es) to search for may be any :term:`bytes-like object`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
233a3f9d-ceb6-4d83-b454-7532e997e797 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,844 | supabase-export-v2 | 4646f4e4d5c095c4 | 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 complete
* if concatenating :class:`bytes` objects, you can similarly use
:meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place
concatenation with a :class:`bytea... | trusted_official_docs | CPython Docs | 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 complete
* if concatenating :class:`bytes` objects, you can similarly use
:meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place
concatenation with a :class:`bytea... | 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 complete
* if concatenating :class:`bytes` objects, you can similarly use
:meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place
concatenation with a :class:`bytea... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
23ae4b51-f637-4bb6-80fd-88e6edbfd2a3 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,574 | supabase-export-v2 | 5eaa0fb1e18c02f1 | .. method:: bytes.splitlines(keepends=False) bytearray.splitlines(keepends=False)
Return a list of the lines in the binary sequence, breaking at ASCII
line boundaries. This method uses the :term:`universal newlines` approach
to splitting lines. Line breaks are not included in the resulting list
unless *keepends* is ... | trusted_official_docs | CPython Docs | .. method:: bytes.splitlines(keepends=False) bytearray.splitlines(keepends=False)
Return a list of the lines in the binary sequence, breaking at ASCII
line boundaries. This method uses the :term:`universal newlines` approach
to splitting lines. Line breaks are not included in the resulting list
unless *keepends* is ... | .. method:: bytes.splitlines(keepends=False) bytearray.splitlines(keepends=False)
Return a list of the lines in the binary sequence, breaking at ASCII
line boundaries. This method uses the :term:`universal newlines` approach
to splitting lines. Line breaks are not included in the resulting list
unless *keepends* is ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
23ef0742-fd1f-48cb-8202-77a0d03417c9 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,963 | supabase-export-v2 | f1eb0c77e8fd1dfb | for more about the various forms of string literal, including supported :ref:`escape sequences <escape-sequences>`, and the ``r`` ("raw") prefix that disables most escape sequence processing.
Strings may also be created from other objects using the :class:`str`
constructor. | trusted_official_docs | CPython Docs | for more about the various forms of string literal, including supported :ref:`escape sequences <escape-sequences>`, and the ``r`` ("raw") prefix that disables most escape sequence processing.
Strings may also be created from other objects using the :class:`str`
constructor. | for more about the various forms of string literal, including supported :ref:`escape sequences <escape-sequences>`, and the ``r`` ("raw") prefix that disables most escape sequence processing.
Strings may also be created from other objects using the :class:`str`
constructor. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
24622001-34e0-42ee-aeaa-ae83e1374c27 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,667 | supabase-export-v2 | 2c4581fff60553d3 | | | | | | *im* defaults to zero.
| | |
+---------------------+---------------------------------+---------+--------------------+
| ``c.conjugate()`` | conjugate of the complex number | | |
| | *c* | | |
+---------------------+---------------------------------+---------+--------------------+
| ``divmod(x, y)`` | the pair... | trusted_official_docs | CPython Docs | | | | | | *im* defaults to zero.
| | |
+---------------------+---------------------------------+---------+--------------------+
| ``c.conjugate()`` | conjugate of the complex number | | |
| | *c* | | |
+---------------------+---------------------------------+---------+--------------------+
| ``divmod(x, y)`` | the pair... | | | | | | *im* defaults to zero.
| | |
+---------------------+---------------------------------+---------+--------------------+
| ``c.conjugate()`` | conjugate of the complex number | | |
| | *c* | | |
+---------------------+---------------------------------+---------+--------------------+
| ``divmod(x, y)`` | the pair... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
25020bc0-6255-42e0-9f0d-e60e816a0d41 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,695 | supabase-export-v2 | 082453c3590adcf6 | bit-width of ``1 + max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the same result as if there were an infinite number of sign bits.
Additional Methods on Integer Types
----------------------------------- | trusted_official_docs | CPython Docs | bit-width of ``1 + max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the same result as if there were an infinite number of sign bits.
Additional Methods on Integer Types
----------------------------------- | bit-width of ``1 + max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the same result as if there were an infinite number of sign bits.
Additional Methods on Integer Types
----------------------------------- | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
251cfc4c-d28a-483f-9adc-155f236c73c2 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,933 | supabase-export-v2 | 57e907480796a221 | the value constraint. Ranges do support negative indices, but these are interpreted as indexing from the end of the sequence determined by the positive indices.
Ranges containing absolute values larger than :data:`sys.maxsize` are
permitted but some features (such as :func:`len`) may raise
:exc:`OverflowError`. | trusted_official_docs | CPython Docs | the value constraint. Ranges do support negative indices, but these are interpreted as indexing from the end of the sequence determined by the positive indices.
Ranges containing absolute values larger than :data:`sys.maxsize` are
permitted but some features (such as :func:`len`) may raise
:exc:`OverflowError`. | the value constraint. Ranges do support negative indices, but these are interpreted as indexing from the end of the sequence determined by the positive indices.
Ranges containing absolute values larger than :data:`sys.maxsize` are
permitted but some features (such as :func:`len`) may raise
:exc:`OverflowError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
27741a34-87f4-4403-a2fa-7c20c643c437 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,514 | supabase-export-v2 | 4b6226e6f99fd3bf | >>> b'1,2,3'.split(b',') [b'1', b'2', b'3'] >>> b'1,2,3'.split(b',', maxsplit=1) [b'1', b'2,3'] >>> b'1,2,,3,'.split(b',') [b'1', b'2', b'', b'3', b''] >>> b'1<>2<>3<4'.split(b'<>') [b'1', b'2', b'3<4']
If *sep* is not specified or is ``None``, a different splitting algorithm
is applied: runs of consecutive ASCII whit... | trusted_official_docs | CPython Docs | >>> b'1,2,3'.split(b',') [b'1', b'2', b'3'] >>> b'1,2,3'.split(b',', maxsplit=1) [b'1', b'2,3'] >>> b'1,2,,3,'.split(b',') [b'1', b'2', b'', b'3', b''] >>> b'1<>2<>3<4'.split(b'<>') [b'1', b'2', b'3<4']
If *sep* is not specified or is ``None``, a different splitting algorithm
is applied: runs of consecutive ASCII whit... | >>> b'1,2,3'.split(b',') [b'1', b'2', b'3'] >>> b'1,2,3'.split(b',', maxsplit=1) [b'1', b'2,3'] >>> b'1,2,,3,'.split(b',') [b'1', b'2', b'', b'3', b''] >>> b'1<>2<>3<4'.split(b'<>') [b'1', b'2', b'3<4']
If *sep* is not specified or is ``None``, a different splitting algorithm
is applied: runs of consecutive ASCII whit... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
27a9df52-0b6c-4489-a00d-4720d6f3a211 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,248 | supabase-export-v2 | 20bdb6dbc74663c5 | >>> number = 14.3 >>> f'{number=}' 'number=14.3'
Whitespace before, inside and after the expression, as well as whitespace
after the equal sign, is significant --- it is retained in the result:: | trusted_official_docs | CPython Docs | >>> number = 14.3 >>> f'{number=}' 'number=14.3'
Whitespace before, inside and after the expression, as well as whitespace
after the equal sign, is significant --- it is retained in the result:: | >>> number = 14.3 >>> f'{number=}' 'number=14.3'
Whitespace before, inside and after the expression, as well as whitespace
after the equal sign, is significant --- it is retained in the result:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
27fb5139-9337-476a-b6a8-e5551bea24e7 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,698 | supabase-export-v2 | deaf128cb24abe16 | >>> memoryview(b'abc').tolist() [97, 98, 99] >>> import array >>> a = array.array('d', [1.1, 2.2, 3.3]) >>> m = memoryview(a) >>> m.tolist() [1.1, 2.2, 3.3]
.. versionchanged:: 3.3
:meth:`tolist` now supports all single character native formats in
:mod:`struct` module syntax as well as multi-dimensional
representati... | trusted_official_docs | CPython Docs | >>> memoryview(b'abc').tolist() [97, 98, 99] >>> import array >>> a = array.array('d', [1.1, 2.2, 3.3]) >>> m = memoryview(a) >>> m.tolist() [1.1, 2.2, 3.3]
.. versionchanged:: 3.3
:meth:`tolist` now supports all single character native formats in
:mod:`struct` module syntax as well as multi-dimensional
representati... | >>> memoryview(b'abc').tolist() [97, 98, 99] >>> import array >>> a = array.array('d', [1.1, 2.2, 3.3]) >>> m = memoryview(a) >>> m.tolist() [1.1, 2.2, 3.3]
.. versionchanged:: 3.3
:meth:`tolist` now supports all single character native formats in
:mod:`struct` module syntax as well as multi-dimensional
representati... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2810966a-db06-4c8e-bb8b-9c070dce1e2f | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,935 | supabase-export-v2 | d4478a71b5bc4d85 | Range examples::
>>> list(range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> list(range(1, 11))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> list(range(0, 30, 5))
[0, 5, 10, 15, 20, 25]
>>> list(range(0, 10, 3))
[0, 3, 6, 9]
>>> list(range(0, -10, -1))
[0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
>>> list(range(0))
[]
>>> lis... | trusted_official_docs | CPython Docs | Range examples::
>>> list(range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> list(range(1, 11))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> list(range(0, 30, 5))
[0, 5, 10, 15, 20, 25]
>>> list(range(0, 10, 3))
[0, 3, 6, 9]
>>> list(range(0, -10, -1))
[0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
>>> list(range(0))
[]
>>> lis... | Range examples::
>>> list(range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> list(range(1, 11))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> list(range(0, 30, 5))
[0, 5, 10, 15, 20, 25]
>>> list(range(0, 10, 3))
[0, 3, 6, 9]
>>> list(range(0, -10, -1))
[0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
>>> list(range(0))
[]
>>> lis... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
29ee2759-709a-4945-8ad8-0edcc10559ac | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,531 | supabase-export-v2 | 31809408c01ba90b | Any other byte value is copied unchanged and the current column is incremented by one regardless of how the byte value is represented when printed::
>>> b'01\t012\t0123\t01234'.expandtabs()
b'01 012 0123 01234'
>>> b'01\t012\t0123\t01234'.expandtabs(4)
b'01 012 0123 01234' | trusted_official_docs | CPython Docs | Any other byte value is copied unchanged and the current column is incremented by one regardless of how the byte value is represented when printed::
>>> b'01\t012\t0123\t01234'.expandtabs()
b'01 012 0123 01234'
>>> b'01\t012\t0123\t01234'.expandtabs(4)
b'01 012 0123 01234' | Any other byte value is copied unchanged and the current column is incremented by one regardless of how the byte value is represented when printed::
>>> b'01\t012\t0123\t01234'.expandtabs()
b'01 012 0123 01234'
>>> b'01\t012\t0123\t01234'.expandtabs(4)
b'01 012 0123 01234' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2b09fc16-6a2a-4edd-ae7c-25baae729aa4 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,946 | supabase-export-v2 | 10e7745b5d90448c | 2) >>> 11 in r False >>> 10 in r True >>> r.index(10) 5 >>> r[5] 10 >>> r[:5] range(0, 10, 2) >>> r[-1] 18
Testing range objects for equality with ``==`` and ``!=`` compares
them as sequences. That is, two range objects are considered equal if
they represent the same sequence of values. (Note that two range
objects tha... | trusted_official_docs | CPython Docs | 2) >>> 11 in r False >>> 10 in r True >>> r.index(10) 5 >>> r[5] 10 >>> r[:5] range(0, 10, 2) >>> r[-1] 18
Testing range objects for equality with ``==`` and ``!=`` compares
them as sequences. That is, two range objects are considered equal if
they represent the same sequence of values. (Note that two range
objects tha... | 2) >>> 11 in r False >>> 10 in r True >>> r.index(10) 5 >>> r[5] 10 >>> r[:5] range(0, 10, 2) >>> r[-1] 18
Testing range objects for equality with ``==`` and ``!=`` compares
them as sequences. That is, two range objects are considered equal if
they represent the same sequence of values. (Note that two range
objects tha... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2b270244-0d1b-456d-b967-684b5b434a35 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,833 | supabase-export-v2 | de2bf4a6bf7004fe | >>> "gg" in "eggs" True
(2)
Values of *n* less than ``0`` are treated as ``0`` (which yields an empty
sequence of the same type as *s*). Note that items in the sequence *s*
are not copied; they are referenced multiple times. This often haunts
new Python programmers; consider:: | trusted_official_docs | CPython Docs | >>> "gg" in "eggs" True
(2)
Values of *n* less than ``0`` are treated as ``0`` (which yields an empty
sequence of the same type as *s*). Note that items in the sequence *s*
are not copied; they are referenced multiple times. This often haunts
new Python programmers; consider:: | >>> "gg" in "eggs" True
(2)
Values of *n* less than ``0`` are treated as ``0`` (which yields an empty
sequence of the same type as *s*). Note that items in the sequence *s*
are not copied; they are referenced multiple times. This often haunts
new Python programmers; consider:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2bf4d2c3-a37b-489b-b16e-dae489bde2ce | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,472 | supabase-export-v2 | de2fc1458bad812c | .. method:: bytes.startswith(prefix[, start[, end]]) bytearray.startswith(prefix[, start[, end]])
Return ``True`` if the binary data starts with the specified *prefix*,
otherwise return ``False``. *prefix* can also be a tuple of prefixes to
look for. With optional *start*, test beginning at that position. With
optio... | trusted_official_docs | CPython Docs | .. method:: bytes.startswith(prefix[, start[, end]]) bytearray.startswith(prefix[, start[, end]])
Return ``True`` if the binary data starts with the specified *prefix*,
otherwise return ``False``. *prefix* can also be a tuple of prefixes to
look for. With optional *start*, test beginning at that position. With
optio... | .. method:: bytes.startswith(prefix[, start[, end]]) bytearray.startswith(prefix[, start[, end]])
Return ``True`` if the binary data starts with the specified *prefix*,
otherwise return ``False``. *prefix* can also be a tuple of prefixes to
look for. With optional *start*, test beginning at that position. With
optio... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2c1abef9-e10b-4f11-8afc-e8be58982a1d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,336 | supabase-export-v2 | 06738391ad952dea | Also see the :ref:`bytes <func-bytes>` built-in.
Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal
numbers are a commonly used format for describing binary data. Accordingly,
the bytes type has an additional class method to read data in that format: | trusted_official_docs | CPython Docs | Also see the :ref:`bytes <func-bytes>` built-in.
Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal
numbers are a commonly used format for describing binary data. Accordingly,
the bytes type has an additional class method to read data in that format: | Also see the :ref:`bytes <func-bytes>` built-in.
Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal
numbers are a commonly used format for describing binary data. Accordingly,
the bytes type has an additional class method to read data in that format: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2c486475-f6c6-4a6f-a09b-d357fb9ccfaa | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,242 | supabase-export-v2 | 03a2e9def94e318b | results of arbitrary Python expressions within *replacement fields*, which are delimited by curly brackets (``{}``). Each replacement field must contain an expression, optionally followed by:
* a *debug specifier* -- an equal sign (``=``);
* a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or
* a *format speci... | trusted_official_docs | CPython Docs | results of arbitrary Python expressions within *replacement fields*, which are delimited by curly brackets (``{}``). Each replacement field must contain an expression, optionally followed by:
* a *debug specifier* -- an equal sign (``=``);
* a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or
* a *format speci... | results of arbitrary Python expressions within *replacement fields*, which are delimited by curly brackets (``{}``). Each replacement field must contain an expression, optionally followed by:
* a *debug specifier* -- an equal sign (``=``);
* a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or
* a *format speci... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2cbedaea-53b9-4076-9d17-fc835a850cfb | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,111 | supabase-export-v2 | b71a2e78fcaa0de3 | This static method returns a translation table usable for :meth:`str.translate`.
If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters (strings of length 1) to Unicode ordinals,
strings (of arbitrary lengths) or ``None``. Character keys will then be
converted to ord... | trusted_official_docs | CPython Docs | This static method returns a translation table usable for :meth:`str.translate`.
If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters (strings of length 1) to Unicode ordinals,
strings (of arbitrary lengths) or ``None``. Character keys will then be
converted to ord... | This static method returns a translation table usable for :meth:`str.translate`.
If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters (strings of length 1) to Unicode ordinals,
strings (of arbitrary lengths) or ``None``. Character keys will then be
converted to ord... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2cedf582-c02a-46fb-8c2a-70e09269f8ca | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,615 | supabase-export-v2 | a850724be56fcc2e | .. note::
The formatting operations described here exhibit a variety of quirks that
lead to a number of common errors (such as failing to display tuples and
dictionaries correctly). If the value being printed may be a tuple or
dictionary, wrap it in a tuple. | trusted_official_docs | CPython Docs | .. note::
The formatting operations described here exhibit a variety of quirks that
lead to a number of common errors (such as failing to display tuples and
dictionaries correctly). If the value being printed may be a tuple or
dictionary, wrap it in a tuple. | .. note::
The formatting operations described here exhibit a variety of quirks that
lead to a number of common errors (such as failing to display tuples and
dictionaries correctly). If the value being printed may be a tuple or
dictionary, wrap it in a tuple. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2de56f04-83f2-4f8f-a20d-da78057b0a74 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,823 | supabase-export-v2 | 96c52c5d978fb8dc | most sequence types, both mutable and immutable. The :class:`collections.abc.Sequence` ABC is provided to make it easier to correctly implement these operations on custom sequence types.
This table lists the sequence operations sorted in ascending priority. In the
table, *s* and *t* are sequences of the same type, *n*,... | trusted_official_docs | CPython Docs | most sequence types, both mutable and immutable. The :class:`collections.abc.Sequence` ABC is provided to make it easier to correctly implement these operations on custom sequence types.
This table lists the sequence operations sorted in ascending priority. In the
table, *s* and *t* are sequences of the same type, *n*,... | most sequence types, both mutable and immutable. The :class:`collections.abc.Sequence` ABC is provided to make it easier to correctly implement these operations on custom sequence types.
This table lists the sequence operations sorted in ascending priority. In the
table, *s* and *t* are sequences of the same type, *n*,... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2df890ae-136f-45e2-8617-5af52144c4ef | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,719 | supabase-export-v2 | 106b582821d58ba9 | Equivalent to::
def to_bytes(n, length=1, byteorder='big', signed=False):
if byteorder == 'little':
order = range(length)
elif byteorder == 'big':
order = reversed(range(length))
else:
raise ValueError("byteorder must be either 'little' or 'big'") | trusted_official_docs | CPython Docs | Equivalent to::
def to_bytes(n, length=1, byteorder='big', signed=False):
if byteorder == 'little':
order = range(length)
elif byteorder == 'big':
order = reversed(range(length))
else:
raise ValueError("byteorder must be either 'little' or 'big'") | Equivalent to::
def to_bytes(n, length=1, byteorder='big', signed=False):
if byteorder == 'little':
order = range(length)
elif byteorder == 'big':
order = reversed(range(length))
else:
raise ValueError("byteorder must be either 'little' or 'big'") | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e7db6fe-db77-4966-a67e-3514918edab2 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,734 | supabase-export-v2 | 3b623bf230b9a9b9 | .. method:: int.as_integer_ratio()
Return a pair of integers whose ratio is equal to the original
integer and has a positive denominator. The integer ratio of integers
(whole numbers) is always the integer as the numerator and ``1`` as the
denominator. | trusted_official_docs | CPython Docs | .. method:: int.as_integer_ratio()
Return a pair of integers whose ratio is equal to the original
integer and has a positive denominator. The integer ratio of integers
(whole numbers) is always the integer as the numerator and ``1`` as the
denominator. | .. method:: int.as_integer_ratio()
Return a pair of integers whose ratio is equal to the original
integer and has a positive denominator. The integer ratio of integers
(whole numbers) is always the integer as the numerator and ``1`` as the
denominator. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2ed91bb1-a69a-4535-8e04-c2d0c8c81d1b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,806 | supabase-export-v2 | 87ab59b3831c9b69 | which supports both breadth-first and depth-first traversal.) This method corresponds to the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects in the Python/C API.
The iterator objects themselves are required to support the following two
methods, which together form the :dfn:`iterator prot... | trusted_official_docs | CPython Docs | which supports both breadth-first and depth-first traversal.) This method corresponds to the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects in the Python/C API.
The iterator objects themselves are required to support the following two
methods, which together form the :dfn:`iterator prot... | which supports both breadth-first and depth-first traversal.) This method corresponds to the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects in the Python/C API.
The iterator objects themselves are required to support the following two
methods, which together form the :dfn:`iterator prot... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2f18a898-cdf6-48a4-aab4-1e9d5ea257f5 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,775 | supabase-export-v2 | d952892f97856e9c | Here are the rules in detail:
- If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible
by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n,
P)`` gives the inverse of ``n`` modulo ``P``. | trusted_official_docs | CPython Docs | Here are the rules in detail:
- If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible
by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n,
P)`` gives the inverse of ``n`` modulo ``P``. | Here are the rules in detail:
- If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible
by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n,
P)`` gives the inverse of ``n`` modulo ``P``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2f2c9ef2-ce1c-4491-b6ab-d9c2ebdb6808 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,341 | supabase-export-v2 | 7a9643593fe8c5ad | .. versionchanged:: 3.7 :meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just spaces.
.. versionchanged:: 3.14
:meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and
:term:`bytes-like objects <bytes-like object>` as input. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.7 :meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just spaces.
.. versionchanged:: 3.14
:meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and
:term:`bytes-like objects <bytes-like object>` as input. | .. versionchanged:: 3.7 :meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just spaces.
.. versionchanged:: 3.14
:meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and
:term:`bytes-like objects <bytes-like object>` as input. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2f7f0a91-28ad-4ec0-a701-67da00532525 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,836 | supabase-export-v2 | 1a09339ce7da8b86 | this single empty list. Modifying any of the elements of ``lists`` modifies this single list. You can create a list of different lists this way::
>>> lists = [[] for i in range(3)]
>>> lists[0].append(3)
>>> lists[1].append(5)
>>> lists[2].append(7)
>>> lists
[[3], [5], [7]] | trusted_official_docs | CPython Docs | this single empty list. Modifying any of the elements of ``lists`` modifies this single list. You can create a list of different lists this way::
>>> lists = [[] for i in range(3)]
>>> lists[0].append(3)
>>> lists[1].append(5)
>>> lists[2].append(7)
>>> lists
[[3], [5], [7]] | this single empty list. Modifying any of the elements of ``lists`` modifies this single list. You can create a list of different lists this way::
>>> lists = [[] for i in range(3)]
>>> lists[0].append(3)
>>> lists[1].append(5)
>>> lists[2].append(7)
>>> lists
[[3], [5], [7]] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2fdb0d7b-d23d-4793-972d-c12bbc2daa23 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,461 | supabase-export-v2 | 811a88e969cdd54b | .. method:: bytes.rfind(sub[, start[, end]]) bytearray.rfind(sub[, start[, end]])
Return the highest index in the sequence where the subsequence *sub* is
found, such that *sub* is contained within ``s[start:end]``. Optional
arguments *start* and *end* are interpreted as in slice notation. Return
``-1`` on failure. | trusted_official_docs | CPython Docs | .. method:: bytes.rfind(sub[, start[, end]]) bytearray.rfind(sub[, start[, end]])
Return the highest index in the sequence where the subsequence *sub* is
found, such that *sub* is contained within ``s[start:end]``. Optional
arguments *start* and *end* are interpreted as in slice notation. Return
``-1`` on failure. | .. method:: bytes.rfind(sub[, start[, end]]) bytearray.rfind(sub[, start[, end]])
Return the highest index in the sequence where the subsequence *sub* is
found, such that *sub* is contained within ``s[start:end]``. Optional
arguments *start* and *end* are interpreted as in slice notation. Return
``-1`` on failure. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2fffbc2f-c508-4638-9fb9-4eda5dbf80f1 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,908 | supabase-export-v2 | 1e5cbddfff7178df | then used for the entire sorting process. The default value of ``None`` means that list items are sorted directly without calculating a separate key value.
The :func:`functools.cmp_to_key` utility is available to convert a 2.x
style *cmp* function to a *key* function. | trusted_official_docs | CPython Docs | then used for the entire sorting process. The default value of ``None`` means that list items are sorted directly without calculating a separate key value.
The :func:`functools.cmp_to_key` utility is available to convert a 2.x
style *cmp* function to a *key* function. | then used for the entire sorting process. The default value of ``None`` means that list items are sorted directly without calculating a separate key value.
The :func:`functools.cmp_to_key` utility is available to convert a 2.x
style *cmp* function to a *key* function. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
300b5e9b-1bed-4cba-ae8c-e2dc14fc9899 | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,188 | supabase-export-v2 | 0926e4f792fff936 | *sep* is given, this method returns an empty list for the empty string, and a terminal line break does not result in an extra line::
>>> "".splitlines()
[]
>>> "One line\n".splitlines()
['One line'] | trusted_official_docs | CPython Docs | *sep* is given, this method returns an empty list for the empty string, and a terminal line break does not result in an extra line::
>>> "".splitlines()
[]
>>> "One line\n".splitlines()
['One line'] | *sep* is given, this method returns an empty list for the empty string, and a terminal line break does not result in an extra line::
>>> "".splitlines()
[]
>>> "One line\n".splitlines()
['One line'] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3079c8cd-c9f9-4e8d-9a79-3a17c2fe3c7b | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 23,282 | supabase-export-v2 | 78f9da4a0dd239dd | >>> print('%s has %d quote types.' % ('Python', 2)) Python has 2 quote types.
If *format* requires a single argument, *values* may be a single non-tuple
object. [5]_ Otherwise, *values* must be a tuple with exactly the number of
items specified by the format string, or a single mapping object (for example, a
dictionary... | trusted_official_docs | CPython Docs | >>> print('%s has %d quote types.' % ('Python', 2)) Python has 2 quote types.
If *format* requires a single argument, *values* may be a single non-tuple
object. [5]_ Otherwise, *values* must be a tuple with exactly the number of
items specified by the format string, or a single mapping object (for example, a
dictionary... | >>> print('%s has %d quote types.' % ('Python', 2)) Python has 2 quote types.
If *format* requires a single argument, *values* may be a single non-tuple
object. [5]_ Otherwise, *values* must be a tuple with exactly the number of
items specified by the format string, or a single mapping object (for example, a
dictionary... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
31d7de5c-7950-4f40-af22-7d9fb632819d | CPython Docs | file://datasets/cpython/Doc/library/stdtypes.rst | unknown | a3cf8bc4-60ee-4147-adb3-d0deb77581ec | 22,811 | supabase-export-v2 | 26fa67af0d54fe51 | no further items, raise the :exc:`StopIteration` exception. This method corresponds to the :c:member:`~PyTypeObject.tp_iternext` slot of the type structure for Python objects in the Python/C API.
Python defines several iterator objects to support iteration over general and
specific sequence types, dictionaries, and oth... | trusted_official_docs | CPython Docs | no further items, raise the :exc:`StopIteration` exception. This method corresponds to the :c:member:`~PyTypeObject.tp_iternext` slot of the type structure for Python objects in the Python/C API.
Python defines several iterator objects to support iteration over general and
specific sequence types, dictionaries, and oth... | no further items, raise the :exc:`StopIteration` exception. This method corresponds to the :c:member:`~PyTypeObject.tp_iternext` slot of the type structure for Python objects in the Python/C API.
Python defines several iterator objects to support iteration over general and
specific sequence types, dictionaries, and oth... | 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.