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
32116db6-ebb8-427a-a2e3-578272c06d91
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,418
supabase-export-v2
ea6f6dd07f31bb8a
the binary data ends with the *suffix* string and that *suffix* is not empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the original binary data:: >>> b'MiscTests'.removesuffix(b'Tests') b'Misc' >>> b'TmpDirMixin'.removesuffix(b'Tests') b'TmpDirMixin'
trusted_official_docs
CPython Docs
the binary data ends with the *suffix* string and that *suffix* is not empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the original binary data:: >>> b'MiscTests'.removesuffix(b'Tests') b'Misc' >>> b'TmpDirMixin'.removesuffix(b'Tests') b'TmpDirMixin'
the binary data ends with the *suffix* string and that *suffix* is not empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the original binary data:: >>> b'MiscTests'.removesuffix(b'Tests') b'Misc' >>> b'TmpDirMixin'.removesuffix(b'Tests') b'TmpDirMixin'
python, official-docs, cpython, P0
Local_Trusted_Corpus
32a224c9-8749-4d50-8401-f129bf0249f5
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,825
supabase-export-v2
0c53cf2c58da0fec
have the same priorities as the comparison operations. The ``+`` (concatenation) and ``*`` (repetition) operations have the same priority as the corresponding numeric operations. [3]_ .. index:: triple: operations on; sequence; types pair: built-in function; len pair: built-in function; min pair: built-in function;...
trusted_official_docs
CPython Docs
have the same priorities as the comparison operations. The ``+`` (concatenation) and ``*`` (repetition) operations have the same priority as the corresponding numeric operations. [3]_ .. index:: triple: operations on; sequence; types pair: built-in function; len pair: built-in function; min pair: built-in function;...
have the same priorities as the comparison operations. The ``+`` (concatenation) and ``*`` (repetition) operations have the same priority as the corresponding numeric operations. [3]_ .. index:: triple: operations on; sequence; types pair: built-in function; len pair: built-in function; min pair: built-in function;...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3365f0ad-7ace-4082-8f7c-ff7352c756dd
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,671
supabase-export-v2
1d084105c3dc0d07
One-dimensional memoryviews of :term:`hashable` (read-only) types with formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m.tobytes())``:: >>> 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...
trusted_official_docs
CPython Docs
One-dimensional memoryviews of :term:`hashable` (read-only) types with formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m.tobytes())``:: >>> 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...
One-dimensional memoryviews of :term:`hashable` (read-only) types with formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m.tobytes())``:: >>> 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...
python, official-docs, cpython, P0
Local_Trusted_Corpus
33e09453-3ebb-45ad-a64b-415c1d5affed
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,489
supabase-export-v2
708ee6db27c27922
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.lstrip(bytes=None, /) bytearray.lstrip(bytes=None, /)
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.lstrip(bytes=None, /) bytearray.lstrip(bytes=None, /)
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.lstrip(bytes=None, /) bytearray.lstrip(bytes=None, /)
python, official-docs, cpython, P0
Local_Trusted_Corpus
34b7d150-f068-451d-b6e3-e29ad5f210cc
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,220
supabase-export-v2
cfe3a5881026b7c5
Alternatively, a workaround for apostrophes can be constructed using regular expressions:: >>> import re >>> def titlecase(s): ... return re.sub(r"[A-Za-z]+('[A-Za-z]+)?", ... lambda mo: mo.group(0).capitalize(), ... s) ... >>> titlecase("they're bill's friends.") "They're Bill's Friends."
trusted_official_docs
CPython Docs
Alternatively, a workaround for apostrophes can be constructed using regular expressions:: >>> import re >>> def titlecase(s): ... return re.sub(r"[A-Za-z]+('[A-Za-z]+)?", ... lambda mo: mo.group(0).capitalize(), ... s) ... >>> titlecase("they're bill's friends.") "They're Bill's Friends."
Alternatively, a workaround for apostrophes can be constructed using regular expressions:: >>> import re >>> def titlecase(s): ... return re.sub(r"[A-Za-z]+('[A-Za-z]+)?", ... lambda mo: mo.group(0).capitalize(), ... s) ... >>> titlecase("they're bill's friends.") "They're Bill's Friends."
python, official-docs, cpython, P0
Local_Trusted_Corpus
35b6c17d-292b-4ebb-ae51-0208517907b5
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,557
supabase-export-v2
c4a4841d438fac1f
.. method:: bytes.istitle() bytearray.istitle() Return ``True`` if the sequence is ASCII titlecase and the sequence is not empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the definition of "titlecase".
trusted_official_docs
CPython Docs
.. method:: bytes.istitle() bytearray.istitle() Return ``True`` if the sequence is ASCII titlecase and the sequence is not empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the definition of "titlecase".
.. method:: bytes.istitle() bytearray.istitle() Return ``True`` if the sequence is ASCII titlecase and the sequence is not empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the definition of "titlecase".
python, official-docs, cpython, P0
Local_Trusted_Corpus
35bb9171-1712-4a39-a25d-0ee374750f7c
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,197
supabase-export-v2
54fdfc30b4297d37
.. method:: str.strip(chars=None, /) Return a copy of the string with the leading and trailing characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix or suffix...
trusted_official_docs
CPython Docs
.. method:: str.strip(chars=None, /) Return a copy of the string with the leading and trailing characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix or suffix...
.. method:: str.strip(chars=None, /) Return a copy of the string with the leading and trailing characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix or suffix...
python, official-docs, cpython, P0
Local_Trusted_Corpus
360f826e-1383-48ff-a4f6-9354c7b464aa
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,964
supabase-export-v2
25a28b24c8d1bd57
Strings may also be created from other objects using the :class:`str` constructor. Since there is no separate "character" type, indexing a string produces strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``.
trusted_official_docs
CPython Docs
Strings may also be created from other objects using the :class:`str` constructor. Since there is no separate "character" type, indexing a string produces strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``.
Strings may also be created from other objects using the :class:`str` constructor. Since there is no separate "character" type, indexing a string produces strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
364651cc-af75-4da0-812a-cf931da060bd
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,399
supabase-export-v2
3e9db3443a1d0e57
.. note:: The methods on bytes and bytearray objects don't accept strings as their arguments, just as the methods on strings don't accept bytes as their arguments. For example, you have to write::
trusted_official_docs
CPython Docs
.. note:: The methods on bytes and bytearray objects don't accept strings as their arguments, just as the methods on strings don't accept bytes as their arguments. For example, you have to write::
.. note:: The methods on bytes and bytearray objects don't accept strings as their arguments, just as the methods on strings don't accept bytes as their arguments. For example, you have to write::
python, official-docs, cpython, P0
Local_Trusted_Corpus
36e1584e-ff7e-4772-8dbf-19f2177ffec9
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,329
supabase-export-v2
3d686560f037e563
Firstly, the syntax for bytes literals is largely the same as that for string literals, except that a ``b`` prefix is added: * Single quotes: ``b'still allows embedded "double" quotes'`` * Double quotes: ``b"still allows embedded 'single' quotes"`` * Triple quoted: ``b'''3 single quotes'''``, ``b"""3 double quotes"""...
trusted_official_docs
CPython Docs
Firstly, the syntax for bytes literals is largely the same as that for string literals, except that a ``b`` prefix is added: * Single quotes: ``b'still allows embedded "double" quotes'`` * Double quotes: ``b"still allows embedded 'single' quotes"`` * Triple quoted: ``b'''3 single quotes'''``, ``b"""3 double quotes"""...
Firstly, the syntax for bytes literals is largely the same as that for string literals, except that a ``b`` prefix is added: * Single quotes: ``b'still allows embedded "double" quotes'`` * Double quotes: ``b"still allows embedded 'single' quotes"`` * Triple quoted: ``b'''3 single quotes'''``, ``b"""3 double quotes"""...
python, official-docs, cpython, P0
Local_Trusted_Corpus
36f3d341-3099-40d5-b8c4-b6992b24b44b
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,669
supabase-export-v2
65fc2af099e86ba9
If the underlying object is writable, the memoryview supports one-dimensional slice assignment. Resizing is not allowed:: >>> data = bytearray(b'abcefg') >>> v = memoryview(data) >>> v.readonly False >>> v[0] = ord(b'z') >>> data bytearray(b'zbcefg') >>> v[1:4] = b'123' >>> data bytearray(b'z123fg') >>> v[2:3...
trusted_official_docs
CPython Docs
If the underlying object is writable, the memoryview supports one-dimensional slice assignment. Resizing is not allowed:: >>> data = bytearray(b'abcefg') >>> v = memoryview(data) >>> v.readonly False >>> v[0] = ord(b'z') >>> data bytearray(b'zbcefg') >>> v[1:4] = b'123' >>> data bytearray(b'z123fg') >>> v[2:3...
If the underlying object is writable, the memoryview supports one-dimensional slice assignment. Resizing is not allowed:: >>> data = bytearray(b'abcefg') >>> v = memoryview(data) >>> v.readonly False >>> v[0] = ord(b'z') >>> data bytearray(b'zbcefg') >>> v[1:4] = b'123' >>> data bytearray(b'z123fg') >>> v[2:3...
python, official-docs, cpython, P0
Local_Trusted_Corpus
377bf158-d6ca-4095-8974-fdd0f87011d3
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,302
supabase-export-v2
3b87606a2d71149e
| \(1) | +------------+-----------------------------------------------------+-------+ | ``'u'`` | Obsolete type -- it is identical to ``'d'``. | \(6) | +------------+-----------------------------------------------------+-------+ | ``'x'`` | Signed hexadecimal (lowercase). | \(2) | +------------+------------------------...
trusted_official_docs
CPython Docs
| \(1) | +------------+-----------------------------------------------------+-------+ | ``'u'`` | Obsolete type -- it is identical to ``'d'``. | \(6) | +------------+-----------------------------------------------------+-------+ | ``'x'`` | Signed hexadecimal (lowercase). | \(2) | +------------+------------------------...
| \(1) | +------------+-----------------------------------------------------+-------+ | ``'u'`` | Obsolete type -- it is identical to ``'d'``. | \(6) | +------------+-----------------------------------------------------+-------+ | ``'x'`` | Signed hexadecimal (lowercase). | \(2) | +------------+------------------------...
python, official-docs, cpython, P0
Local_Trusted_Corpus
37bc0739-28ed-4955-8674-7fe6fde8e677
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,902
supabase-export-v2
66a99bdc1cc2648d
'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If no argument is given, the constructor creates a new empty list, ``[]``. Many other operations also produce lists, including the :func:`sorted` built-in.
trusted_official_docs
CPython Docs
'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If no argument is given, the constructor creates a new empty list, ``[]``. Many other operations also produce lists, including the :func:`sorted` built-in.
'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If no argument is given, the constructor creates a new empty list, ``[]``. Many other operations also produce lists, including the :func:`sorted` built-in.
python, official-docs, cpython, P0
Local_Trusted_Corpus
38b1788f-6764-4c48-b9fc-b57884068bd3
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,326
supabase-export-v2
7ba2d28f14ba8fa2
.. index:: pair: object; bytes Bytes objects are immutable sequences of single bytes. Since many major binary protocols are based on the ASCII text encoding, bytes objects offer several methods that are only valid when working with ASCII compatible data and are closely related to string objects in a variety of other wa...
trusted_official_docs
CPython Docs
.. index:: pair: object; bytes Bytes objects are immutable sequences of single bytes. Since many major binary protocols are based on the ASCII text encoding, bytes objects offer several methods that are only valid when working with ASCII compatible data and are closely related to string objects in a variety of other wa...
.. index:: pair: object; bytes Bytes objects are immutable sequences of single bytes. Since many major binary protocols are based on the ASCII text encoding, bytes objects offer several methods that are only valid when working with ASCII compatible data and are closely related to string objects in a variety of other wa...
python, official-docs, cpython, P0
Local_Trusted_Corpus
38d98215-f131-4343-bdcb-6217e96d06de
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,715
supabase-export-v2
398986d3cd826df0
Cast 1D/unsigned bytes to 1D/char:: >>> b = bytearray(b'zyz') >>> x = memoryview(b) >>> x[0] = 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')
trusted_official_docs
CPython Docs
Cast 1D/unsigned bytes to 1D/char:: >>> b = bytearray(b'zyz') >>> x = memoryview(b) >>> x[0] = 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/unsigned bytes to 1D/char:: >>> b = bytearray(b'zyz') >>> x = memoryview(b) >>> x[0] = 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')
python, official-docs, cpython, P0
Local_Trusted_Corpus
3a2d6d34-e05d-49d0-8d3f-b412ef10154f
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,683
supabase-export-v2
b6804fbb853fcb99
c_long)] ... >>> point = BEPoint(100, 200) >>> a = memoryview(point) >>> b = memoryview(point) >>> a == point False >>> a == b False Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v == w`` for memoryview objects.
trusted_official_docs
CPython Docs
c_long)] ... >>> point = BEPoint(100, 200) >>> a = memoryview(point) >>> b = memoryview(point) >>> a == point False >>> a == b False Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v == w`` for memoryview objects.
c_long)] ... >>> point = BEPoint(100, 200) >>> a = memoryview(point) >>> b = memoryview(point) >>> a == point False >>> a == b False Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v == w`` for memoryview objects.
python, official-docs, cpython, P0
Local_Trusted_Corpus
3b0257fd-3758-49c9-a682-39d76da50237
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,664
supabase-export-v2
0ce86c28cf7de6b8
A :class:`memoryview` supports slicing and indexing to expose its data. One-dimensional slicing will result in a subview:: >>> v = memoryview(b'abcefg') >>> v[1] 98 >>> v[-1] 103 >>> v[1:4] <memory at 0x7f3ddc9f4350> >>> bytes(v[1:4]) b'bce'
trusted_official_docs
CPython Docs
A :class:`memoryview` supports slicing and indexing to expose its data. One-dimensional slicing will result in a subview:: >>> v = memoryview(b'abcefg') >>> v[1] 98 >>> v[-1] 103 >>> v[1:4] <memory at 0x7f3ddc9f4350> >>> bytes(v[1:4]) b'bce'
A :class:`memoryview` supports slicing and indexing to expose its data. One-dimensional slicing will result in a subview:: >>> v = memoryview(b'abcefg') >>> v[1] 98 >>> v[-1] 103 >>> v[1:4] <memory at 0x7f3ddc9f4350> >>> bytes(v[1:4]) b'bce'
python, official-docs, cpython, P0
Local_Trusted_Corpus
3cefe963-7c06-41f1-9691-19383b05c498
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,641
supabase-export-v2
094a77573bce2c92
This table summarizes the comparison operations: +------------+-------------------------+ | Operation | Meaning | +============+=========================+ | ``<`` | strictly less than | +------------+-------------------------+ | ``<=`` | less than or equal | +------------+-------------------------+ | ``>`` | strictly g...
trusted_official_docs
CPython Docs
This table summarizes the comparison operations: +------------+-------------------------+ | Operation | Meaning | +============+=========================+ | ``<`` | strictly less than | +------------+-------------------------+ | ``<=`` | less than or equal | +------------+-------------------------+ | ``>`` | strictly g...
This table summarizes the comparison operations: +------------+-------------------------+ | Operation | Meaning | +============+=========================+ | ``<`` | strictly less than | +------------+-------------------------+ | ``<=`` | less than or equal | +------------+-------------------------+ | ``>`` | strictly g...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3cf4a0c8-7035-4d48-b19f-346d8b900ccc
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,856
supabase-export-v2
54e31cefbd8ae065
Raises :exc:`ValueError` if *value* is not found in *sequence*. The *start* or *stop* arguments allow for efficient searching of subsections of the sequence, beginning at *start* and ending at *stop*. This is roughly equivalent to ``start + sequence[start:stop].index(value)``, only without copying any data.
trusted_official_docs
CPython Docs
Raises :exc:`ValueError` if *value* is not found in *sequence*. The *start* or *stop* arguments allow for efficient searching of subsections of the sequence, beginning at *start* and ending at *stop*. This is roughly equivalent to ``start + sequence[start:stop].index(value)``, only without copying any data.
Raises :exc:`ValueError` if *value* is not found in *sequence*. The *start* or *stop* arguments allow for efficient searching of subsections of the sequence, beginning at *start* and ending at *stop*. This is roughly equivalent to ``start + sequence[start:stop].index(value)``, only without copying any data.
python, official-docs, cpython, P0
Local_Trusted_Corpus
3d082e16-f052-49bf-af15-9c32f7e016a6
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,030
supabase-export-v2
739714312016a7d0
.. method:: str.format_map(mapping, /) Similar to ``str.format(**mapping)``, except that ``mapping`` is used directly and not copied to a :class:`dict`. This is useful if for example ``mapping`` is a dict subclass:
trusted_official_docs
CPython Docs
.. method:: str.format_map(mapping, /) Similar to ``str.format(**mapping)``, except that ``mapping`` is used directly and not copied to a :class:`dict`. This is useful if for example ``mapping`` is a dict subclass:
.. method:: str.format_map(mapping, /) Similar to ``str.format(**mapping)``, except that ``mapping`` is used directly and not copied to a :class:`dict`. This is useful if for example ``mapping`` is a dict subclass:
python, official-docs, cpython, P0
Local_Trusted_Corpus
3d2b11ab-b1b3-4e53-a94c-fbefd463acfc
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,730
supabase-export-v2
3ac2b63d2df6ee42
byteorder='big', signed=False): if byteorder == 'little': little_ordered = list(bytes) elif byteorder == 'big': little_ordered = list(reversed(bytes)) else: raise ValueError("byteorder must be either 'little' or 'big'") n = sum(b << i*8 for i, b in enumerate(little_ordered)) if signed and little_ordered and (little_or...
trusted_official_docs
CPython Docs
byteorder='big', signed=False): if byteorder == 'little': little_ordered = list(bytes) elif byteorder == 'big': little_ordered = list(reversed(bytes)) else: raise ValueError("byteorder must be either 'little' or 'big'") n = sum(b << i*8 for i, b in enumerate(little_ordered)) if signed and little_ordered and (little_or...
byteorder='big', signed=False): if byteorder == 'little': little_ordered = list(bytes) elif byteorder == 'big': little_ordered = list(reversed(bytes)) else: raise ValueError("byteorder must be either 'little' or 'big'") n = sum(b << i*8 for i, b in enumerate(little_ordered)) if signed and little_ordered and (little_or...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3d6beadf-f11a-4a1f-9f12-c30bb8826c48
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,760
supabase-export-v2
092df352b76c06ea
a hexadecimal floating-point literal in C or Java code, and hexadecimal strings produced by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted by :meth:`float.fromhex`. Note that the exponent is written in decimal rather than hexadecimal, and that it gives the power of 2 by which to multiply the ...
trusted_official_docs
CPython Docs
a hexadecimal floating-point literal in C or Java code, and hexadecimal strings produced by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted by :meth:`float.fromhex`. Note that the exponent is written in decimal rather than hexadecimal, and that it gives the power of 2 by which to multiply the ...
a hexadecimal floating-point literal in C or Java code, and hexadecimal strings produced by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted by :meth:`float.fromhex`. Note that the exponent is written in decimal rather than hexadecimal, and that it gives the power of 2 by which to multiply the ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3e2f2d9f-6598-474e-aa2e-2fd62487d01a
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,455
supabase-export-v2
05f399207e1ce295
.. method:: bytes.replace(old, new, /, count=-1) bytearray.replace(old, new, /, count=-1) Return a copy of the sequence with all occurrences of subsequence *old* replaced by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are re...
trusted_official_docs
CPython Docs
.. method:: bytes.replace(old, new, /, count=-1) bytearray.replace(old, new, /, count=-1) Return a copy of the sequence with all occurrences of subsequence *old* replaced by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are re...
.. method:: bytes.replace(old, new, /, count=-1) bytearray.replace(old, new, /, count=-1) Return a copy of the sequence with all occurrences of subsequence *old* replaced by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are re...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3e6b4185-3c4d-4493-a0b5-a846910b4394
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,751
supabase-export-v2
af2851156e90033a
>>> (-2.0).is_integer() True >>> (3.2).is_integer() False Two methods support conversion to and from hexadecimal strings. Since Python's floats are stored internally as binary numbers, converting a float to or from a *decimal* string usually involves a small rounding error. In contrast, hexadecimal strings allow exact ...
trusted_official_docs
CPython Docs
>>> (-2.0).is_integer() True >>> (3.2).is_integer() False Two methods support conversion to and from hexadecimal strings. Since Python's floats are stored internally as binary numbers, converting a float to or from a *decimal* string usually involves a small rounding error. In contrast, hexadecimal strings allow exact ...
>>> (-2.0).is_integer() True >>> (3.2).is_integer() False Two methods support conversion to and from hexadecimal strings. Since Python's floats are stored internally as binary numbers, converting a float to or from a *decimal* string usually involves a small rounding error. In contrast, hexadecimal strings allow exact ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3ed40183-29cf-4782-9a95-c6d8970814cd
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,153
supabase-export-v2
030a4a3bce0499fa
.. method:: str.rpartition(sep, /) Split the string at the last occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing two empty strings, followed by the string itself.
trusted_official_docs
CPython Docs
.. method:: str.rpartition(sep, /) Split the string at the last occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing two empty strings, followed by the string itself.
.. method:: str.rpartition(sep, /) Split the string at the last occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing two empty strings, followed by the string itself.
python, official-docs, cpython, P0
Local_Trusted_Corpus
3f553ff2-1cea-4538-96e6-0b9c494cc1c3
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,613
supabase-export-v2
34d90ff6892e66ab
``printf``-style Bytes Formatting ---------------------------------- .. index:: single: formatting; bytes (%) single: formatting; bytearray (%) single: interpolation; bytes (%) single: interpolation; bytearray (%) single: bytes; formatting single: bytearray; formatting single: bytes; interpolation single: bytea...
trusted_official_docs
CPython Docs
``printf``-style Bytes Formatting ---------------------------------- .. index:: single: formatting; bytes (%) single: formatting; bytearray (%) single: interpolation; bytes (%) single: interpolation; bytearray (%) single: bytes; formatting single: bytearray; formatting single: bytes; interpolation single: bytea...
``printf``-style Bytes Formatting ---------------------------------- .. index:: single: formatting; bytes (%) single: formatting; bytearray (%) single: interpolation; bytes (%) single: interpolation; bytearray (%) single: bytes; formatting single: bytearray; formatting single: bytes; interpolation single: bytea...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3f7560b6-e692-4de6-abad-a1f816eef261
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,668
supabase-export-v2
33be6c547a02c958
to the power *y* | \(5) | :func:`pow` | +---------------------+---------------------------------+---------+--------------------+ | ``x ** y`` | *x* to the power *y* | \(5) | | +---------------------+---------------------------------+---------+--------------------+ .. index:: triple: operations on; numeric; types sing...
trusted_official_docs
CPython Docs
to the power *y* | \(5) | :func:`pow` | +---------------------+---------------------------------+---------+--------------------+ | ``x ** y`` | *x* to the power *y* | \(5) | | +---------------------+---------------------------------+---------+--------------------+ .. index:: triple: operations on; numeric; types sing...
to the power *y* | \(5) | :func:`pow` | +---------------------+---------------------------------+---------+--------------------+ | ``x ** y`` | *x* to the power *y* | \(5) | | +---------------------+---------------------------------+---------+--------------------+ .. index:: triple: operations on; numeric; types sing...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3fbdc493-f40c-40a2-9d3a-109d6593c0b2
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,133
supabase-export-v2
2dbe62e48019b1d2
.. method:: str.replace(old, new, /, count=-1) Return a copy of the string with all occurrences of substring *old* replaced by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are replaced. For example:
trusted_official_docs
CPython Docs
.. method:: str.replace(old, new, /, count=-1) Return a copy of the string with all occurrences of substring *old* replaced by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are replaced. For example:
.. method:: str.replace(old, new, /, count=-1) Return a copy of the string with all occurrences of substring *old* replaced by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are replaced. For example:
python, official-docs, cpython, P0
Local_Trusted_Corpus
40d112dc-0d92-4d85-b68f-e9b52d0411ae
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,174
supabase-export-v2
8e348a0b7ee09dde
>>> '1 2 3'.split() ['1', '2', '3'] >>> '1 2 3'.split(maxsplit=1) ['1', '2 3'] >>> ' 1 2 3 '.split() ['1', '2', '3'] If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only leading runs of consecutive whitespace are considered.
trusted_official_docs
CPython Docs
>>> '1 2 3'.split() ['1', '2', '3'] >>> '1 2 3'.split(maxsplit=1) ['1', '2 3'] >>> ' 1 2 3 '.split() ['1', '2', '3'] If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only leading runs of consecutive whitespace are considered.
>>> '1 2 3'.split() ['1', '2', '3'] >>> '1 2 3'.split(maxsplit=1) ['1', '2 3'] >>> ' 1 2 3 '.split() ['1', '2', '3'] If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only leading runs of consecutive whitespace are considered.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4187f6ff-b8b7-433a-ae44-c2957cd839a6
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,857
supabase-export-v2
b1971f9a3107e554
of subsections of the sequence, beginning at *start* and ending at *stop*. This is roughly equivalent to ``start + sequence[start:stop].index(value)``, only without copying any data. .. caution:: Not all sequence types support passing the *start* and *stop* arguments.
trusted_official_docs
CPython Docs
of subsections of the sequence, beginning at *start* and ending at *stop*. This is roughly equivalent to ``start + sequence[start:stop].index(value)``, only without copying any data. .. caution:: Not all sequence types support passing the *start* and *stop* arguments.
of subsections of the sequence, beginning at *start* and ending at *stop*. This is roughly equivalent to ``start + sequence[start:stop].index(value)``, only without copying any data. .. caution:: Not all sequence types support passing the *start* and *stop* arguments.
python, official-docs, cpython, P0
Local_Trusted_Corpus
41d5e20b-1fb8-47a8-889b-f963c992be96
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,672
supabase-export-v2
2a9763ab7b4647ba
(2) Not for complex numbers. Instead convert to floats using :func:`abs` if appropriate. (3) .. index:: pair: module; math single: floor() (in module math) single: ceil() (in module math) single: trunc() (in module math) pair: numeric; conversions
trusted_official_docs
CPython Docs
(2) Not for complex numbers. Instead convert to floats using :func:`abs` if appropriate. (3) .. index:: pair: module; math single: floor() (in module math) single: ceil() (in module math) single: trunc() (in module math) pair: numeric; conversions
(2) Not for complex numbers. Instead convert to floats using :func:`abs` if appropriate. (3) .. index:: pair: module; math single: floor() (in module math) single: ceil() (in module math) single: trunc() (in module math) pair: numeric; conversions
python, official-docs, cpython, P0
Local_Trusted_Corpus
420c77be-51e2-4dea-b010-a8b8b8b4dbae
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,684
supabase-export-v2
9450b3c09b2a8a02
Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v == w`` for memoryview objects. .. versionchanged:: 3.3 Previous versions compared the raw memory disregarding the item format and the logical array structure.
trusted_official_docs
CPython Docs
Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v == w`` for memoryview objects. .. versionchanged:: 3.3 Previous versions compared the raw memory disregarding the item format and the logical array structure.
Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v == w`` for memoryview objects. .. versionchanged:: 3.3 Previous versions compared the raw memory disregarding the item format and the logical array structure.
python, official-docs, cpython, P0
Local_Trusted_Corpus
42422b03-3c29-4dab-8555-7981fb5e47a2
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,932
supabase-export-v2
29ef970d4811a034
of the range are still determined by the formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and ``r[i] > stop``. A range object will be empty if ``r[0]`` does not meet the value constraint. Ranges do support negative indices, but these are interpreted as indexing from the end of the sequence determ...
trusted_official_docs
CPython Docs
of the range are still determined by the formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and ``r[i] > stop``. A range object will be empty if ``r[0]`` does not meet the value constraint. Ranges do support negative indices, but these are interpreted as indexing from the end of the sequence determ...
of the range are still determined by the formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and ``r[i] > stop``. A range object will be empty if ``r[0]`` does not meet the value constraint. Ranges do support negative indices, but these are interpreted as indexing from the end of the sequence determ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
44063b8e-274b-4631-998c-a03e5328762e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,971
supabase-export-v2
f34e62c5ec899d6a
*object*. If *object* is not provided, returns the empty string. Otherwise, the behavior of ``str()`` depends on whether *encoding* or *errors* is given, as follows. If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:`type(object).__str__(object) <object.__str__>`, which is the "informal" or n...
trusted_official_docs
CPython Docs
*object*. If *object* is not provided, returns the empty string. Otherwise, the behavior of ``str()`` depends on whether *encoding* or *errors* is given, as follows. If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:`type(object).__str__(object) <object.__str__>`, which is the "informal" or n...
*object*. If *object* is not provided, returns the empty string. Otherwise, the behavior of ``str()`` depends on whether *encoding* or *errors* is given, as follows. If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:`type(object).__str__(object) <object.__str__>`, which is the "informal" or n...
python, official-docs, cpython, P0
Local_Trusted_Corpus
44730a1f-2b11-47f4-8efc-d0ecb895c050
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,167
supabase-export-v2
e4e950c05820f9ff
.. method:: str.split(sep=None, maxsplit=-1) Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` elements). If *maxsplit* is not specified or ``-1``, then there is no limit on the nu...
trusted_official_docs
CPython Docs
.. method:: str.split(sep=None, maxsplit=-1) Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` elements). If *maxsplit* is not specified or ``-1``, then there is no limit on the nu...
.. method:: str.split(sep=None, maxsplit=-1) Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` elements). If *maxsplit* is not specified or ``-1``, then there is no limit on the nu...
python, official-docs, cpython, P0
Local_Trusted_Corpus
44752009-b7c5-4be5-814f-7edd787e0793
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,605
supabase-export-v2
9d1c2b9a29e6a9d2
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.zfill(width, /) bytearray.zfill(width, /)
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.zfill(width, /) bytearray.zfill(width, /)
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.zfill(width, /) bytearray.zfill(width, /)
python, official-docs, cpython, P0
Local_Trusted_Corpus
44b2b8ae-6d5d-42ee-9799-56db3974e454
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,660
supabase-export-v2
02d81d70a742129f
For many simple types such as :class:`bytes` and :class:`bytearray`, an element is a single byte, but other types such as :class:`array.array` may have bigger elements. ``len(view)`` is equal to the length of :meth:`~memoryview.tolist`, which is the nested list representation of the view. If ``view.ndim = 1``, this i...
trusted_official_docs
CPython Docs
For many simple types such as :class:`bytes` and :class:`bytearray`, an element is a single byte, but other types such as :class:`array.array` may have bigger elements. ``len(view)`` is equal to the length of :meth:`~memoryview.tolist`, which is the nested list representation of the view. If ``view.ndim = 1``, this i...
For many simple types such as :class:`bytes` and :class:`bytearray`, an element is a single byte, but other types such as :class:`array.array` may have bigger elements. ``len(view)`` is equal to the length of :meth:`~memoryview.tolist`, which is the nested list representation of the view. If ``view.ndim = 1``, this i...
python, official-docs, cpython, P0
Local_Trusted_Corpus
452ad8b4-bf58-4eec-9dd1-3120e18878ac
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,351
supabase-export-v2
9791601230600d45
will be a bytes object of length 1. (This contrasts with text strings, where both indexing and slicing will produce a string of length 1) The representation of bytes objects uses the literal format (``b'...'``) since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can always convert a bytes object into a...
trusted_official_docs
CPython Docs
will be a bytes object of length 1. (This contrasts with text strings, where both indexing and slicing will produce a string of length 1) The representation of bytes objects uses the literal format (``b'...'``) since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can always convert a bytes object into a...
will be a bytes object of length 1. (This contrasts with text strings, where both indexing and slicing will produce a string of length 1) The representation of bytes objects uses the literal format (``b'...'``) since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can always convert a bytes object into a...
python, official-docs, cpython, P0
Local_Trusted_Corpus
461d8211-9bf5-4dbc-a124-896a4e262c15
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,827
supabase-export-v2
2049ccc6f9940fbd
of *s* | | +--------------------------+--------------------------------+----------+ | ``min(s)`` | smallest item of *s* | | +--------------------------+--------------------------------+----------+ | ``max(s)`` | largest item of *s* | | +--------------------------+--------------------------------+----------+ Sequences o...
trusted_official_docs
CPython Docs
of *s* | | +--------------------------+--------------------------------+----------+ | ``min(s)`` | smallest item of *s* | | +--------------------------+--------------------------------+----------+ | ``max(s)`` | largest item of *s* | | +--------------------------+--------------------------------+----------+ Sequences o...
of *s* | | +--------------------------+--------------------------------+----------+ | ``min(s)`` | smallest item of *s* | | +--------------------------+--------------------------------+----------+ | ``max(s)`` | largest item of *s* | | +--------------------------+--------------------------------+----------+ Sequences o...
python, official-docs, cpython, P0
Local_Trusted_Corpus
46464c62-980f-44c2-a1a1-868bdab5f7c2
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,456
supabase-export-v2
d1fc68857d192b71
by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are replaced. The subsequence to search for and its replacement may be any :term:`bytes-like object`.
trusted_official_docs
CPython Docs
by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are replaced. The subsequence to search for and its replacement may be any :term:`bytes-like object`.
by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are replaced. The subsequence to search for and its replacement may be any :term:`bytes-like object`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
46db98a2-c0ab-42dc-ba8c-22ebc68cb47e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,965
supabase-export-v2
fe6361728697766c
Since there is no separate "character" type, indexing a string produces strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``. .. index:: pair: object; io.StringIO
trusted_official_docs
CPython Docs
Since there is no separate "character" type, indexing a string produces strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``. .. index:: pair: object; io.StringIO
Since there is no separate "character" type, indexing a string produces strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``. .. index:: pair: object; io.StringIO
python, official-docs, cpython, P0
Local_Trusted_Corpus
48b5f24b-b687-413d-8607-13beba9a32bc
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,668
supabase-export-v2
e756c7e92aad9bc4
>>> import array >>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444]) >>> m = memoryview(a) >>> m[0] -11111111 >>> m[-1] 44444444 >>> m[::2].tolist() [-11111111, -33333333] If the underlying object is writable, the memoryview supports one-dimensional slice assignment. Resizing is not allowed::
trusted_official_docs
CPython Docs
>>> import array >>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444]) >>> m = memoryview(a) >>> m[0] -11111111 >>> m[-1] 44444444 >>> m[::2].tolist() [-11111111, -33333333] If the underlying object is writable, the memoryview supports one-dimensional slice assignment. Resizing is not allowed::
>>> import array >>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444]) >>> m = memoryview(a) >>> m[0] -11111111 >>> m[-1] 44444444 >>> m[::2].tolist() [-11111111, -33333333] If the underlying object is writable, the memoryview supports one-dimensional slice assignment. Resizing is not allowed::
python, official-docs, cpython, P0
Local_Trusted_Corpus
490c0598-d049-4ef4-954e-36bb2b50f5e3
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,039
supabase-export-v2
44b90b7c1f9b9de4
.. method:: str.isalnum() Return ``True`` if all characters in the string are alphanumeric and there is at least one character, ``False`` otherwise. A character ``c`` is alphanumeric if one of the following returns ``True``: ``c.isalpha()``, ``c.isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``. For example:
trusted_official_docs
CPython Docs
.. method:: str.isalnum() Return ``True`` if all characters in the string are alphanumeric and there is at least one character, ``False`` otherwise. A character ``c`` is alphanumeric if one of the following returns ``True``: ``c.isalpha()``, ``c.isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``. For example:
.. method:: str.isalnum() Return ``True`` if all characters in the string are alphanumeric and there is at least one character, ``False`` otherwise. A character ``c`` is alphanumeric if one of the following returns ``True``: ``c.isalpha()``, ``c.isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``. For example:
python, official-docs, cpython, P0
Local_Trusted_Corpus
49917b6a-18bd-493c-9289-e3bf3dd784c5
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,452
supabase-export-v2
74706eb35baabd84
.. method:: bytes.partition(sep, /) bytearray.partition(sep, /) Split the sequence at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself or its bytearray copy, and the part after the separator. If the separator is not found, return a 3-tuple containing ...
trusted_official_docs
CPython Docs
.. method:: bytes.partition(sep, /) bytearray.partition(sep, /) Split the sequence at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself or its bytearray copy, and the part after the separator. If the separator is not found, return a 3-tuple containing ...
.. method:: bytes.partition(sep, /) bytearray.partition(sep, /) Split the sequence at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself or its bytearray copy, and the part after the separator. If the separator is not found, return a 3-tuple containing ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
49b7c8fe-f0b5-49ed-8520-5e22a184b231
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,453
supabase-export-v2
d07180a793ff61c6
separator. If the separator is not found, return a 3-tuple containing a copy of the original sequence, followed by two empty bytes or bytearray objects. The separator to search for may be any :term:`bytes-like object`.
trusted_official_docs
CPython Docs
separator. If the separator is not found, return a 3-tuple containing a copy of the original sequence, followed by two empty bytes or bytearray objects. The separator to search for may be any :term:`bytes-like object`.
separator. If the separator is not found, return a 3-tuple containing a copy of the original sequence, followed by two empty bytes or bytearray objects. The separator to search for may be any :term:`bytes-like object`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
49febecd-8d53-4c25-b0ac-1932638051b5
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,614
supabase-export-v2
3ca87f693de073ac
The methods that add, subtract, or rearrange their members in place, and don't return a specific item, never return the collection instance itself but ``None``. Some operations are supported by several object types; in particular, practically all objects can be compared for equality, tested for truth value, and convert...
trusted_official_docs
CPython Docs
The methods that add, subtract, or rearrange their members in place, and don't return a specific item, never return the collection instance itself but ``None``. Some operations are supported by several object types; in particular, practically all objects can be compared for equality, tested for truth value, and convert...
The methods that add, subtract, or rearrange their members in place, and don't return a specific item, never return the collection instance itself but ``None``. Some operations are supported by several object types; in particular, practically all objects can be compared for equality, tested for truth value, and convert...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4a64d672-e34d-48c4-9475-3795fec13bc0
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,930
supabase-export-v2
9d332ddcdd9ad878
*step* argument is omitted, it defaults to ``1``. If the *start* argument is omitted, it defaults to ``0``. If *step* is zero, :exc:`ValueError` is raised. For a positive *step*, the contents of a range ``r`` are determined by the formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``.
trusted_official_docs
CPython Docs
*step* argument is omitted, it defaults to ``1``. If the *start* argument is omitted, it defaults to ``0``. If *step* is zero, :exc:`ValueError` is raised. For a positive *step*, the contents of a range ``r`` are determined by the formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``.
*step* argument is omitted, it defaults to ``1``. If the *start* argument is omitted, it defaults to ``0``. If *step* is zero, :exc:`ValueError` is raised. For a positive *step*, the contents of a range ``r`` are determined by the formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4ae2fc74-fde9-4209-80e4-006ac7e115ef
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,928
supabase-export-v2
7a5b2fcb35affb4b
The :class:`range` type represents an immutable sequence of numbers and is commonly used for looping a specific number of times in :keyword:`for` loops. .. class:: range(stop, /) range(start, stop, step=1, /)
trusted_official_docs
CPython Docs
The :class:`range` type represents an immutable sequence of numbers and is commonly used for looping a specific number of times in :keyword:`for` loops. .. class:: range(stop, /) range(start, stop, step=1, /)
The :class:`range` type represents an immutable sequence of numbers and is commonly used for looping a specific number of times in :keyword:`for` loops. .. class:: range(stop, /) range(start, stop, step=1, /)
python, official-docs, cpython, P0
Local_Trusted_Corpus
4ba4101b-0ed9-4899-9411-7d077e80802e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,677
supabase-export-v2
f77d5f75eae8964c
(6) The numeric literals accepted include the digits ``0`` to ``9`` or any Unicode equivalent (code points with the ``Nd`` property). See `the Unicode Standard <https://unicode.org/Public/UNIDATA/extracted/DerivedNumericType.txt>`_ for a complete list of code points with the ``Nd`` property.
trusted_official_docs
CPython Docs
(6) The numeric literals accepted include the digits ``0`` to ``9`` or any Unicode equivalent (code points with the ``Nd`` property). See `the Unicode Standard <https://unicode.org/Public/UNIDATA/extracted/DerivedNumericType.txt>`_ for a complete list of code points with the ``Nd`` property.
(6) The numeric literals accepted include the digits ``0`` to ``9`` or any Unicode equivalent (code points with the ``Nd`` property). See `the Unicode Standard <https://unicode.org/Public/UNIDATA/extracted/DerivedNumericType.txt>`_ for a complete list of code points with the ``Nd`` property.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4ce2a316-72b7-4e8d-b6d8-eb83d9470611
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,707
supabase-export-v2
e51e801489b31817
The context management protocol can be used for a similar effect, using the ``with`` statement:: >>> with memoryview(b'abc') as m: ... m[0] ... 97 >>> m[0] Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: operation forbidden on released memoryview object
trusted_official_docs
CPython Docs
The context management protocol can be used for a similar effect, using the ``with`` statement:: >>> with memoryview(b'abc') as m: ... m[0] ... 97 >>> 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:: >>> with memoryview(b'abc') as m: ... m[0] ... 97 >>> m[0] Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: operation forbidden on released memoryview object
python, official-docs, cpython, P0
Local_Trusted_Corpus
4d887916-71cb-4169-aad6-77d599925f4d
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,688
supabase-export-v2
d40f7d7db504337f
>>> m = memoryview(b"abc") >>> m.tobytes() b'abc' >>> bytes(m) b'abc' For non-contiguous arrays the result is equal to the flattened list representation with all elements converted to bytes. :meth:`tobytes` supports all format strings, including those that are not in :mod:`struct` module syntax.
trusted_official_docs
CPython Docs
>>> m = memoryview(b"abc") >>> m.tobytes() b'abc' >>> bytes(m) b'abc' For non-contiguous arrays the result is equal to the flattened list representation with all elements converted to bytes. :meth:`tobytes` supports all format strings, including those that are not in :mod:`struct` module syntax.
>>> m = memoryview(b"abc") >>> m.tobytes() b'abc' >>> bytes(m) b'abc' For non-contiguous arrays the result is equal to the flattened list representation with all elements converted to bytes. :meth:`tobytes` supports all format strings, including those that are not in :mod:`struct` module syntax.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4de364d1-e436-4436-8299-36f9801545f3
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,289
supabase-export-v2
3727e18dd1b17592
is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision. #. Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tu...
trusted_official_docs
CPython Docs
is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision. #. Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tu...
is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision. #. Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tu...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4e44c77d-3b00-4d57-a185-c2ffc18562dc
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,718
supabase-export-v2
a5591a13b69ce55d
>>> y.itemsize 4 >>> len(y) 2 >>> y.nbytes 48 >>> z = y.cast('b') >>> z.format 'b' >>> z.itemsize 1 >>> len(z) 48 >>> z.nbytes 48 Cast 1D/unsigned long to 2D/unsigned long::
trusted_official_docs
CPython Docs
>>> y.itemsize 4 >>> len(y) 2 >>> y.nbytes 48 >>> z = y.cast('b') >>> z.format 'b' >>> z.itemsize 1 >>> len(z) 48 >>> z.nbytes 48 Cast 1D/unsigned long to 2D/unsigned long::
>>> y.itemsize 4 >>> len(y) 2 >>> y.nbytes 48 >>> z = y.cast('b') >>> z.format 'b' >>> z.itemsize 1 >>> len(z) 48 >>> z.nbytes 48 Cast 1D/unsigned long to 2D/unsigned long::
python, official-docs, cpython, P0
Local_Trusted_Corpus
4ea48870-b1fc-4697-8e64-0e85fad01e85
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,043
supabase-export-v2
24ffb52b79df414d
.. method:: str.isalpha() Return ``True`` if all characters in the string are alphabetic and there is at least one character, ``False`` otherwise. Alphabetic characters are those characters defined in the Unicode character database as "Letter", i.e., those with general category property being one of "Lm", "Lt", "Lu"...
trusted_official_docs
CPython Docs
.. method:: str.isalpha() Return ``True`` if all characters in the string are alphabetic and there is at least one character, ``False`` otherwise. Alphabetic characters are those characters defined in the Unicode character database as "Letter", i.e., those with general category property being one of "Lm", "Lt", "Lu"...
.. method:: str.isalpha() Return ``True`` if all characters in the string are alphabetic and there is at least one character, ``False`` otherwise. Alphabetic characters are those characters defined in the Unicode character database as "Letter", i.e., those with general category property being one of "Lm", "Lt", "Lu"...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4fe66d33-b447-4cb7-b79b-16bc8b856069
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,106
supabase-export-v2
bfedd068a23f56d7
omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix; rather, all combinations of its values are stripped:: >>> ' spacious '.lstrip() 'spacious ' >>> 'www.example.com'.lstrip('cmowz.') 'example.com'
trusted_official_docs
CPython Docs
omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix; rather, all combinations of its values are stripped:: >>> ' spacious '.lstrip() 'spacious ' >>> 'www.example.com'.lstrip('cmowz.') 'example.com'
omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix; rather, all combinations of its values are stripped:: >>> ' spacious '.lstrip() 'spacious ' >>> 'www.example.com'.lstrip('cmowz.') 'example.com'
python, official-docs, cpython, P0
Local_Trusted_Corpus
506071e1-89e3-40f8-91e9-369a4e5c7d82
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,697
supabase-export-v2
7b057ad5f58744e2
Return the data in the buffer as a list of elements. :: >>> 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]
trusted_official_docs
CPython Docs
Return the data in the buffer as a list of elements. :: >>> 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]
Return the data in the buffer as a list of elements. :: >>> 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]
python, official-docs, cpython, P0
Local_Trusted_Corpus
50745ef4-949a-4b43-b46b-43304b78aa26
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,686
supabase-export-v2
42425c6bd9602c7b
masking; operations pair: operator; | (vertical bar) pair: operator; ^ (caret) pair: operator; & (ampersand) pair: operator; << pair: operator; >> pair: operator; ~ (tilde) Bitwise operations only make sense for integers. The result of bitwise operations is calculated as though carried out in two's complement with an i...
trusted_official_docs
CPython Docs
masking; operations pair: operator; | (vertical bar) pair: operator; ^ (caret) pair: operator; & (ampersand) pair: operator; << pair: operator; >> pair: operator; ~ (tilde) Bitwise operations only make sense for integers. The result of bitwise operations is calculated as though carried out in two's complement with an i...
masking; operations pair: operator; | (vertical bar) pair: operator; ^ (caret) pair: operator; & (ampersand) pair: operator; << pair: operator; >> pair: operator; ~ (tilde) Bitwise operations only make sense for integers. The result of bitwise operations is calculated as though carried out in two's complement with an i...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5080943e-a3a7-4b3d-8b03-3f0cbf55e832
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,617
supabase-export-v2
2c9b589ec8190318
conversion specifications in *format* are replaced with zero or more elements of *values*. The effect is similar to using the :c:func:`sprintf` in the C language. 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 ...
trusted_official_docs
CPython Docs
conversion specifications in *format* are replaced with zero or more elements of *values*. The effect is similar to using the :c:func:`sprintf` in the C language. 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 ...
conversion specifications in *format* are replaced with zero or more elements of *values*. The effect is similar to using the :c:func:`sprintf` in the C language. 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 ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
50b45ad1-c6ff-4fbe-b1c8-5ba8f2d3ec53
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,539
supabase-export-v2
214014b3dfda09b1
.. method:: bytes.isalpha() bytearray.isalpha() Return ``True`` if all bytes in the sequence are alphabetic ASCII characters and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``.
trusted_official_docs
CPython Docs
.. method:: bytes.isalpha() bytearray.isalpha() Return ``True`` if all bytes in the sequence are alphabetic ASCII characters and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``.
.. method:: bytes.isalpha() bytearray.isalpha() Return ``True`` if all bytes in the sequence are alphabetic ASCII characters and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
51911a10-72a3-46a5-9bbb-7111deaa3769
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,867
supabase-export-v2
2e1b0e76310ccf62
.. index:: triple: mutable; sequence; types pair: object; list pair: object; bytearray The operations in the following 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.
trusted_official_docs
CPython Docs
.. index:: triple: mutable; sequence; types pair: object; list pair: object; bytearray The operations in the following 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.
.. index:: triple: mutable; sequence; types pair: object; list pair: object; bytearray The operations in the following 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.
python, official-docs, cpython, P0
Local_Trusted_Corpus
51f5e55e-828c-492b-bc8b-a14c86368902
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,968
supabase-export-v2
e25b9f5c1bf39842
is once again permitted on string literals. It has no effect on the meaning of string literals and cannot be combined with the ``r`` prefix. .. index:: single: string; str (built-in class)
trusted_official_docs
CPython Docs
is once again permitted on string literals. It has no effect on the meaning of string literals and cannot be combined with the ``r`` prefix. .. index:: single: string; str (built-in class)
is once again permitted on string literals. It has no effect on the meaning of string literals and cannot be combined with the ``r`` prefix. .. index:: single: string; str (built-in class)
python, official-docs, cpython, P0
Local_Trusted_Corpus
526fc0ad-e4a8-4db8-9540-e709611d34b3
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,272
supabase-export-v2
c902215c84262c9a
the inner expression ``{precision}`` to determine the value of the ``format_spec`` attribute. If ``precision`` were to be ``2``, the resulting format specifier would be ``'.2f'``. * When the equals sign ``'='`` is provided in an interpolation expression, the text of the expression is appended to the literal string tha...
trusted_official_docs
CPython Docs
the inner expression ``{precision}`` to determine the value of the ``format_spec`` attribute. If ``precision`` were to be ``2``, the resulting format specifier would be ``'.2f'``. * When the equals sign ``'='`` is provided in an interpolation expression, the text of the expression is appended to the literal string tha...
the inner expression ``{precision}`` to determine the value of the ``format_spec`` attribute. If ``precision`` were to be ``2``, the resulting format specifier would be ``'.2f'``. * When the equals sign ``'='`` is provided in an interpolation expression, the text of the expression is appended to the literal string tha...
python, official-docs, cpython, P0
Local_Trusted_Corpus
52c06f22-3f8e-4659-b0d9-5dda822bbee5
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,068
supabase-export-v2
c43d041bfaa95a7d
True >>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-indic digit zero to nine True >>> '⅕'.isnumeric() # Vulgar fraction one fifth True >>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric() (False, True, True) See also :meth:`isdecimal` and :meth:`isdigit`. Numeric characters are a superset of decimal numbers.
trusted_official_docs
CPython Docs
True >>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-indic digit zero to nine True >>> '⅕'.isnumeric() # Vulgar fraction one fifth True >>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric() (False, True, True) See also :meth:`isdecimal` and :meth:`isdigit`. Numeric characters are a superset of decimal numbers.
True >>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-indic digit zero to nine True >>> '⅕'.isnumeric() # Vulgar fraction one fifth True >>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric() (False, True, True) See also :meth:`isdecimal` and :meth:`isdigit`. Numeric characters are a superset of decimal numbers.
python, official-docs, cpython, P0
Local_Trusted_Corpus
52cc9ad0-e1e5-40ab-89ed-f44217cc2a5e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,595
supabase-export-v2
94c7e7adc720bd50
A workaround for apostrophes can be constructed using regular expressions:: >>> import re >>> def titlecase(s): ... return re.sub(rb"[A-Za-z]+('[A-Za-z]+)?", ... lambda mo: mo.group(0)[0:1].upper() + ... mo.group(0)[1:].lower(), ... s) ... >>> titlecase(b"they're bill's friends.") b"They're Bill's Friends."
trusted_official_docs
CPython Docs
A workaround for apostrophes can be constructed using regular expressions:: >>> import re >>> def titlecase(s): ... return re.sub(rb"[A-Za-z]+('[A-Za-z]+)?", ... lambda mo: mo.group(0)[0:1].upper() + ... mo.group(0)[1:].lower(), ... s) ... >>> titlecase(b"they're bill's friends.") b"They're Bill's Friends."
A workaround for apostrophes can be constructed using regular expressions:: >>> import re >>> def titlecase(s): ... return re.sub(rb"[A-Za-z]+('[A-Za-z]+)?", ... lambda mo: mo.group(0)[0:1].upper() + ... mo.group(0)[1:].lower(), ... s) ... >>> titlecase(b"they're bill's friends.") b"They're Bill's Friends."
python, official-docs, cpython, P0
Local_Trusted_Corpus
52d057c0-7b3a-426f-af6d-d01117460e88
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,503
supabase-export-v2
993dd69d27c31c14
.. method:: bytes.rstrip(bytes=None, /) bytearray.rstrip(bytes=None, /) Return a copy of the sequence with specified trailing bytes removed. The *bytes* argument is a binary sequence specifying the set of byte values to be removed. If omitted or ``None``, the *bytes* argument defaults to removing ASCII whitespace. T...
trusted_official_docs
CPython Docs
.. method:: bytes.rstrip(bytes=None, /) bytearray.rstrip(bytes=None, /) Return a copy of the sequence with specified trailing bytes removed. The *bytes* argument is a binary sequence specifying the set of byte values to be removed. If omitted or ``None``, the *bytes* argument defaults to removing ASCII whitespace. T...
.. method:: bytes.rstrip(bytes=None, /) bytearray.rstrip(bytes=None, /) Return a copy of the sequence with specified trailing bytes removed. The *bytes* argument is a binary sequence specifying the set of byte values to be removed. If omitted or ``None``, the *bytes* argument defaults to removing ASCII whitespace. T...
python, official-docs, cpython, P0
Local_Trusted_Corpus
534dde2e-96f0-4d8e-9259-2fdf0c228709
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,874
supabase-export-v2
0be3f9ae847ac96b
of *n* clear the sequence. Items in the sequence are not copied; they are referenced multiple times, as explained for ``s * n`` under :ref:`typesseq-common`. .. rubric:: Mutable Sequence Methods
trusted_official_docs
CPython Docs
of *n* clear the sequence. Items in the sequence are not copied; they are referenced multiple times, as explained for ``s * n`` under :ref:`typesseq-common`. .. rubric:: Mutable Sequence Methods
of *n* clear the sequence. Items in the sequence are not copied; they are referenced multiple times, as explained for ``s * n`` under :ref:`typesseq-common`. .. rubric:: Mutable Sequence Methods
python, official-docs, cpython, P0
Local_Trusted_Corpus
535f1e87-23e4-484f-8bfb-3833956023b8
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,013
supabase-export-v2
734fdb86c4d6d8cb
.. method:: str.expandtabs(tabsize=8) Return a copy of the string where all tab characters are replaced by one or more spaces, depending on the current column and the given tab size. Tab positions occur every *tabsize* characters (default is 8, giving tab positions at columns 0, 8, 16 and so on). To expand the strin...
trusted_official_docs
CPython Docs
.. method:: str.expandtabs(tabsize=8) Return a copy of the string where all tab characters are replaced by one or more spaces, depending on the current column and the given tab size. Tab positions occur every *tabsize* characters (default is 8, giving tab positions at columns 0, 8, 16 and so on). To expand the strin...
.. method:: str.expandtabs(tabsize=8) Return a copy of the string where all tab characters are replaced by one or more spaces, depending on the current column and the given tab size. Tab positions occur every *tabsize* characters (default is 8, giving tab positions at columns 0, 8, 16 and so on). To expand the strin...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5367e602-d1f1-4276-b811-002bf60b261c
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,834
supabase-export-v2
dec4bb5eff290181
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:: >>> lists = [[]] * 3 >>> lists [[], [], []] >>> lists[0].append(3) >>> lists [[3], [3], [3]]
trusted_official_docs
CPython Docs
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:: >>> lists = [[]] * 3 >>> lists [[], [], []] >>> lists[0].append(3) >>> lists [[3], [3], [3]]
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:: >>> lists = [[]] * 3 >>> lists [[], [], []] >>> lists[0].append(3) >>> lists [[3], [3], [3]]
python, official-docs, cpython, P0
Local_Trusted_Corpus
548d592f-a1a5-461a-9b5e-c5f25b9443e5
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,627
supabase-export-v2
82d957ea7c77aa72
#. Conversion type. When the right argument is a dictionary (or other mapping type), then the formats in the bytes object *must* include a parenthesised mapping key into that dictionary inserted immediately after the ``'%'`` character. The mapping key selects the value to be formatted from the mapping. For example:
trusted_official_docs
CPython Docs
#. Conversion type. When the right argument is a dictionary (or other mapping type), then the formats in the bytes object *must* include a parenthesised mapping key into that dictionary inserted immediately after the ``'%'`` character. The mapping key selects the value to be formatted from the mapping. For example:
#. Conversion type. When the right argument is a dictionary (or other mapping type), then the formats in the bytes object *must* include a parenthesised mapping key into that dictionary inserted immediately after the ``'%'`` character. The mapping key selects the value to be formatted from the mapping. For example:
python, official-docs, cpython, P0
Local_Trusted_Corpus
54bdb13d-1546-4df4-93f3-4aa87dcb8c8c
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,263
supabase-export-v2
dfee40bc0f2ba1c4
Format specifier ^^^^^^^^^^^^^^^^ After the expression has been evaluated, and possibly converted using an explicit conversion specifier, it is formatted using the :func:`format` function. If the replacement field includes a *format specifier* introduced by a colon (``:``), the specifier is passed to :func:`!format` as...
trusted_official_docs
CPython Docs
Format specifier ^^^^^^^^^^^^^^^^ After the expression has been evaluated, and possibly converted using an explicit conversion specifier, it is formatted using the :func:`format` function. If the replacement field includes a *format specifier* introduced by a colon (``:``), the specifier is passed to :func:`!format` as...
Format specifier ^^^^^^^^^^^^^^^^ After the expression has been evaluated, and possibly converted using an explicit conversion specifier, it is formatted using the :func:`format` function. If the replacement field includes a *format specifier* introduced by a colon (``:``), the specifier is passed to :func:`!format` as...
python, official-docs, cpython, P0
Local_Trusted_Corpus
552dfa75-23e0-4850-9a53-21244ba32558
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,546
supabase-export-v2
3e693327159fdd4c
.. method:: bytes.isdigit() bytearray.isdigit() Return ``True`` if all bytes in the sequence are ASCII decimal digits and the sequence is not empty, ``False`` otherwise. ASCII decimal digits are those byte values in the sequence ``b'0123456789'``.
trusted_official_docs
CPython Docs
.. method:: bytes.isdigit() bytearray.isdigit() Return ``True`` if all bytes in the sequence are ASCII decimal digits and the sequence is not empty, ``False`` otherwise. ASCII decimal digits are those byte values in the sequence ``b'0123456789'``.
.. method:: bytes.isdigit() bytearray.isdigit() Return ``True`` if all bytes in the sequence are ASCII decimal digits and the sequence is not empty, ``False`` otherwise. ASCII decimal digits are those byte values in the sequence ``b'0123456789'``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
559b839f-5c03-46a5-96f3-4feb05940307
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,014
supabase-export-v2
9ee86694cc03c9ed
Any other character is copied unchanged and the current column is incremented by one regardless of how the character is represented when printed. For example:: >>> '01\t012\t0123\t01234'.expandtabs() '01 012 0123 01234' >>> '01\t012\t0123\t01234'.expandtabs(4) '01 012 0123 01234' >>> print('01\t012\n0123\t01234'.ex...
trusted_official_docs
CPython Docs
Any other character is copied unchanged and the current column is incremented by one regardless of how the character is represented when printed. For example:: >>> '01\t012\t0123\t01234'.expandtabs() '01 012 0123 01234' >>> '01\t012\t0123\t01234'.expandtabs(4) '01 012 0123 01234' >>> print('01\t012\n0123\t01234'.ex...
Any other character is copied unchanged and the current column is incremented by one regardless of how the character is represented when printed. For example:: >>> '01\t012\t0123\t01234'.expandtabs() '01 012 0123 01234' >>> '01\t012\t0123\t01234'.expandtabs(4) '01 012 0123 01234' >>> print('01\t012\n0123\t01234'.ex...
python, official-docs, cpython, P0
Local_Trusted_Corpus
55a54baf-12de-452e-baff-f7c761c1bb19
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,944
supabase-export-v2
f92577d8bbdc1cbd
matter the size of the range it represents (as it only stores the ``start``, ``stop`` and ``step`` values, calculating individual items and subranges as needed). Range objects implement the :class:`collections.abc.Sequence` ABC, and provide features such as containment tests, element index lookup, slicing and support f...
trusted_official_docs
CPython Docs
matter the size of the range it represents (as it only stores the ``start``, ``stop`` and ``step`` values, calculating individual items and subranges as needed). Range objects implement the :class:`collections.abc.Sequence` ABC, and provide features such as containment tests, element index lookup, slicing and support f...
matter the size of the range it represents (as it only stores the ``start``, ``stop`` and ``step`` values, calculating individual items and subranges as needed). Range objects implement the :class:`collections.abc.Sequence` ABC, and provide features such as containment tests, element index lookup, slicing and support f...
python, official-docs, cpython, P0
Local_Trusted_Corpus
55db69c2-7566-4acc-b5a7-970c844ad566
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,510
supabase-export-v2
060aadcab9d76531
.. method:: bytes.split(sep=None, maxsplit=-1) bytearray.split(sep=None, maxsplit=-1) Split the binary sequence into subsequences of the same type, using *sep* as the delimiter string. If *maxsplit* is given and non-negative, at most *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` element...
trusted_official_docs
CPython Docs
.. method:: bytes.split(sep=None, maxsplit=-1) bytearray.split(sep=None, maxsplit=-1) Split the binary sequence into subsequences of the same type, using *sep* as the delimiter string. If *maxsplit* is given and non-negative, at most *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` element...
.. method:: bytes.split(sep=None, maxsplit=-1) bytearray.split(sep=None, maxsplit=-1) Split the binary sequence into subsequences of the same type, using *sep* as the delimiter string. If *maxsplit* is given and non-negative, at most *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` element...
python, official-docs, cpython, P0
Local_Trusted_Corpus
562682f2-8bc5-4d40-b070-fad71f0cd135
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,870
supabase-export-v2
80a3ab8998154ab2
.. index:: triple: operations on; sequence; types triple: operations on; list; type pair: subscript; assignment pair: slice; assignment pair: statement; del +------------------------------+--------------------------------+---------------------+ | Operation | Result | Notes | +==============================+============...
trusted_official_docs
CPython Docs
.. index:: triple: operations on; sequence; types triple: operations on; list; type pair: subscript; assignment pair: slice; assignment pair: statement; del +------------------------------+--------------------------------+---------------------+ | Operation | Result | Notes | +==============================+============...
.. index:: triple: operations on; sequence; types triple: operations on; list; type pair: subscript; assignment pair: slice; assignment pair: statement; del +------------------------------+--------------------------------+---------------------+ | Operation | Result | Notes | +==============================+============...
python, official-docs, cpython, P0
Local_Trusted_Corpus
56a74f2a-3dd2-4b76-b9c3-adb930baf5ab
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,988
supabase-export-v2
16835b419c902325
Return a casefolded copy of the string. Casefolded strings may be used for caseless matching. Casefolding is similar to lowercasing but more aggressive because it is intended to remove all case distinctions in a string. For example, the German lowercase letter ``'ß'`` is equivalent to ``"ss"``. Since it is already l...
trusted_official_docs
CPython Docs
Return a casefolded copy of the string. Casefolded strings may be used for caseless matching. Casefolding is similar to lowercasing but more aggressive because it is intended to remove all case distinctions in a string. For example, the German lowercase letter ``'ß'`` is equivalent to ``"ss"``. Since it is already l...
Return a casefolded copy of the string. Casefolded strings may be used for caseless matching. Casefolding is similar to lowercasing but more aggressive because it is intended to remove all case distinctions in a string. For example, the German lowercase letter ``'ß'`` is equivalent to ``"ss"``. Since it is already l...
python, official-docs, cpython, P0
Local_Trusted_Corpus
56d61421-c9f4-4418-ac18-aff725deac5b
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,812
supabase-export-v2
066a244cdcdfa2b3
over general and specific sequence types, dictionaries, and other more specialized forms. The specific types are not important beyond their implementation of the iterator protocol. Once an iterator's :meth:`~iterator.__next__` method raises :exc:`StopIteration`, it must continue to do so on subsequent calls. Implementa...
trusted_official_docs
CPython Docs
over general and specific sequence types, dictionaries, and other more specialized forms. The specific types are not important beyond their implementation of the iterator protocol. Once an iterator's :meth:`~iterator.__next__` method raises :exc:`StopIteration`, it must continue to do so on subsequent calls. Implementa...
over general and specific sequence types, dictionaries, and other more specialized forms. The specific types are not important beyond their implementation of the iterator protocol. Once an iterator's :meth:`~iterator.__next__` method raises :exc:`StopIteration`, it must continue to do so on subsequent calls. Implementa...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5891b2f5-f65e-421f-b77c-a9e816784d29
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,271
supabase-export-v2
bc1dc6ffbb2d7f0e
created for each evaluated expression. It is up to code that processes the resulting :class:`~string.templatelib.Template` object to decide how to handle format specifiers and conversions. * Format specifiers containing nested replacement fields are evaluated eagerly, prior to being passed to the :class:`~string.templ...
trusted_official_docs
CPython Docs
created for each evaluated expression. It is up to code that processes the resulting :class:`~string.templatelib.Template` object to decide how to handle format specifiers and conversions. * Format specifiers containing nested replacement fields are evaluated eagerly, prior to being passed to the :class:`~string.templ...
created for each evaluated expression. It is up to code that processes the resulting :class:`~string.templatelib.Template` object to decide how to handle format specifiers and conversions. * Format specifiers containing nested replacement fields are evaluated eagerly, prior to being passed to the :class:`~string.templ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
58954f9c-e2d2-4eb3-b900-4d8b534628d7
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,308
supabase-export-v2
c78c602c97d1b6e2
(1) The alternate form causes a leading octal specifier (``'0o'``) to be inserted before the first digit. (2) The 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.
trusted_official_docs
CPython Docs
(1) The alternate form causes a leading octal specifier (``'0o'``) to be inserted before the first digit. (2) The 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.
(1) The alternate form causes a leading octal specifier (``'0o'``) to be inserted before the first digit. (2) The 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.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5a23bbcc-dfd4-4eff-8f78-7f9a399ab9c0
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,636
supabase-export-v2
71b5d89e40b6f00f
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
5a661cd7-f5bc-4980-a751-3ebd0776f5b6
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,475
supabase-export-v2
453216e65f682485
.. method:: bytes.translate(table, /, delete=b'') bytearray.translate(table, /, delete=b'') Return a copy of the bytes or bytearray object where all bytes occurring in the optional argument *delete* are removed, and the remaining bytes have been mapped through the given translation table, which must be a bytes objec...
trusted_official_docs
CPython Docs
.. method:: bytes.translate(table, /, delete=b'') bytearray.translate(table, /, delete=b'') Return a copy of the bytes or bytearray object where all bytes occurring in the optional argument *delete* are removed, and the remaining bytes have been mapped through the given translation table, which must be a bytes objec...
.. method:: bytes.translate(table, /, delete=b'') bytearray.translate(table, /, delete=b'') Return a copy of the bytes or bytearray object where all bytes occurring in the optional argument *delete* are removed, and the remaining bytes have been mapped through the given translation table, which must be a bytes objec...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5a6f5978-7e68-4a84-aa48-65a33ccaee03
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,116
supabase-export-v2
b8494048f823ab00
.. method:: str.partition(sep, /) Split the string at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing the string itself, followed by two empty strings.
trusted_official_docs
CPython Docs
.. method:: str.partition(sep, /) Split the string at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing the string itself, followed by two empty strings.
.. method:: str.partition(sep, /) Split the string at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing the string itself, followed by two empty strings.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5aa9486a-e91a-470d-97bc-bac5be4a7fae
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,447
supabase-export-v2
2531cdbc3c4948d3
.. method:: bytes.join(iterable, /) bytearray.join(iterable, /) Return a bytes or bytearray object which is the concatenation of the binary data sequences in *iterable*. A :exc:`TypeError` will be raised if there are any values in *iterable* that are not :term:`bytes-like objects <bytes-like object>`, including :cla...
trusted_official_docs
CPython Docs
.. method:: bytes.join(iterable, /) bytearray.join(iterable, /) Return a bytes or bytearray object which is the concatenation of the binary data sequences in *iterable*. A :exc:`TypeError` will be raised if there are any values in *iterable* that are not :term:`bytes-like objects <bytes-like object>`, including :cla...
.. method:: bytes.join(iterable, /) bytearray.join(iterable, /) Return a bytes or bytearray object which is the concatenation of the binary data sequences in *iterable*. A :exc:`TypeError` will be raised if there are any values in *iterable* that are not :term:`bytes-like objects <bytes-like object>`, including :cla...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5b35b7cf-b598-41ba-8e35-e5992d1b27ba
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,020
supabase-export-v2
8ac0b1a827720270
.. note:: The :meth:`~str.find` method should 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::
trusted_official_docs
CPython Docs
.. note:: The :meth:`~str.find` method should 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::
.. note:: The :meth:`~str.find` method should 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::
python, official-docs, cpython, P0
Local_Trusted_Corpus
5b613bb9-6e8a-4342-8480-ffef6e8cfca1
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,912
supabase-export-v2
4d9d1eb7df5bdbe9
relative order of elements that compare equal --- this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade). For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`.
trusted_official_docs
CPython Docs
relative order of elements that compare equal --- this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade). For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`.
relative order of elements that compare equal --- this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade). For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5c9d85d2-cea2-4d70-b13e-0d1eddaf2ae7
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,667
supabase-export-v2
eb78114b95abfd2a
Here is an example with a non-byte format:: >>> import array >>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444]) >>> m = memoryview(a) >>> m[0] -11111111 >>> m[-1] 44444444 >>> m[::2].tolist() [-11111111, -33333333]
trusted_official_docs
CPython Docs
Here is an example with a non-byte format:: >>> import array >>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444]) >>> m = memoryview(a) >>> m[0] -11111111 >>> m[-1] 44444444 >>> m[::2].tolist() [-11111111, -33333333]
Here is an example with a non-byte format:: >>> import array >>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444]) >>> m = memoryview(a) >>> m[0] -11111111 >>> m[-1] 44444444 >>> m[::2].tolist() [-11111111, -33333333]
python, official-docs, cpython, P0
Local_Trusted_Corpus
5ca7e136-b3eb-445f-a76e-27063e0ddd4f
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,929
supabase-export-v2
646ed71cefc88873
.. class:: range(stop, /) range(start, stop, step=1, /) The arguments to the range constructor must be integers (either built-in :class:`int` or any object that implements the :meth:`~object.__index__` special method). If the *step* argument is omitted, it defaults to ``1``. If the *start* argument is omitted, it def...
trusted_official_docs
CPython Docs
.. class:: range(stop, /) range(start, stop, step=1, /) The arguments to the range constructor must be integers (either built-in :class:`int` or any object that implements the :meth:`~object.__index__` special method). If the *step* argument is omitted, it defaults to ``1``. If the *start* argument is omitted, it def...
.. class:: range(stop, /) range(start, stop, step=1, /) The arguments to the range constructor must be integers (either built-in :class:`int` or any object that implements the :meth:`~object.__index__` special method). If the *step* argument is omitted, it defaults to ``1``. If the *start* argument is omitted, it def...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5dc946ec-f2bb-4198-945e-20094242dc2a
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,297
supabase-export-v2
87d560a956e773ea
.. 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 +---------+---------------------------------------------------------------------+ | Flag | Meaning | +=========+===================...
trusted_official_docs
CPython Docs
.. 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 +---------+---------------------------------------------------------------------+ | Flag | Meaning | +=========+===================...
.. 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 +---------+---------------------------------------------------------------------+ | Flag | Meaning | +=========+===================...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5e7afdf0-2683-47ab-a439-120741375f19
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,644
supabase-export-v2
f090d16e6f5424dd
``>=`` operators are only defined where they make sense; for example, they raise a :exc:`TypeError` exception when one of the arguments is a complex number. .. index:: single: __eq__() (instance method) single: __ne__() (instance method) single: __lt__() (instance method) single: __le__() (instance method) single:...
trusted_official_docs
CPython Docs
``>=`` operators are only defined where they make sense; for example, they raise a :exc:`TypeError` exception when one of the arguments is a complex number. .. index:: single: __eq__() (instance method) single: __ne__() (instance method) single: __lt__() (instance method) single: __le__() (instance method) single:...
``>=`` operators are only defined where they make sense; for example, they raise a :exc:`TypeError` exception when one of the arguments is a complex number. .. index:: single: __eq__() (instance method) single: __ne__() (instance method) single: __lt__() (instance method) single: __le__() (instance method) single:...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5ebf668c-ee5e-495d-a721-7b6f111430c0
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,639
supabase-export-v2
754e10421220b9bc
== pair: operator; < (less) pair: operator; <= pair: operator; > (greater) pair: operator; >= pair: operator; != pair: operator; is pair: operator; is not There are eight comparison operations in Python. They all have the same priority (which is higher than that of the Boolean operations). Comparisons can be chained ar...
trusted_official_docs
CPython Docs
== pair: operator; < (less) pair: operator; <= pair: operator; > (greater) pair: operator; >= pair: operator; != pair: operator; is pair: operator; is not There are eight comparison operations in Python. They all have the same priority (which is higher than that of the Boolean operations). Comparisons can be chained ar...
== pair: operator; < (less) pair: operator; <= pair: operator; > (greater) pair: operator; >= pair: operator; != pair: operator; is pair: operator; is not There are eight comparison operations in Python. They all have the same priority (which is higher than that of the Boolean operations). Comparisons can be chained ar...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5ec2ba29-77b2-4c0c-8f86-93ba4786e32a
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,361
supabase-export-v2
67d4f50b030e2b74
Also see the :ref:`bytearray <func-bytearray>` 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 bytearray type has an additional class method to read data in that format:
trusted_official_docs
CPython Docs
Also see the :ref:`bytearray <func-bytearray>` 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 bytearray type has an additional class method to read data in that format:
Also see the :ref:`bytearray <func-bytearray>` 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 bytearray type has an additional class method to read data in that format:
python, official-docs, cpython, P0
Local_Trusted_Corpus
5ee5e682-c981-4aa4-820e-429bc471175c
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,588
supabase-export-v2
382aee6e06d6e5de
.. method:: bytes.title() bytearray.title() Return a titlecased version of the binary sequence where words start with an uppercase ASCII character and the remaining characters are lowercase. Uncased byte values are left unmodified.
trusted_official_docs
CPython Docs
.. method:: bytes.title() bytearray.title() Return a titlecased version of the binary sequence where words start with an uppercase ASCII character and the remaining characters are lowercase. Uncased byte values are left unmodified.
.. method:: bytes.title() bytearray.title() Return a titlecased version of the binary sequence where words start with an uppercase ASCII character and the remaining characters are lowercase. Uncased byte values are left unmodified.
python, official-docs, cpython, P0
Local_Trusted_Corpus
6056e992-5a6e-4a8a-8df7-13e1db72b377
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,243
supabase-export-v2
9f75e96e9a8b540f
specifier* -- an equal sign (``=``); * a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or * a *format specifier* prefixed with a colon (``:``). See the :ref:`Lexical Analysis section on f-strings <f-strings>` for details on the syntax of these fields.
trusted_official_docs
CPython Docs
specifier* -- an equal sign (``=``); * a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or * a *format specifier* prefixed with a colon (``:``). See the :ref:`Lexical Analysis section on f-strings <f-strings>` for details on the syntax of these fields.
specifier* -- an equal sign (``=``); * a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or * a *format specifier* prefixed with a colon (``:``). See the :ref:`Lexical Analysis section on f-strings <f-strings>` for details on the syntax of these fields.
python, official-docs, cpython, P0
Local_Trusted_Corpus
60b51399-5d15-456e-8f80-3190a4aa9417
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,970
supabase-export-v2
bb6b11c5675a694c
.. class:: str(*, encoding='utf-8', errors='strict') str(object) str(object, encoding, errors='strict') str(object, *, errors) Return a :ref:`string <textseq>` version of *object*. If *object* is not provided, returns the empty string. Otherwise, the behavior of ``str()`` depends on whether *encoding* or *errors* is ...
trusted_official_docs
CPython Docs
.. class:: str(*, encoding='utf-8', errors='strict') str(object) str(object, encoding, errors='strict') str(object, *, errors) Return a :ref:`string <textseq>` version of *object*. If *object* is not provided, returns the empty string. Otherwise, the behavior of ``str()`` depends on whether *encoding* or *errors* is ...
.. class:: str(*, encoding='utf-8', errors='strict') str(object) str(object, encoding, errors='strict') str(object, *, errors) Return a :ref:`string <textseq>` version of *object*. If *object* is not provided, returns the empty string. Otherwise, the behavior of ``str()`` depends on whether *encoding* or *errors* is ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
616d28b3-dc75-4b01-80dd-7021d3d8f9cf
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,246
supabase-export-v2
6399d662ebd01ef8
.. versionadded:: 3.8 If a debug specifier -- an equal sign (``=``) -- appears after the replacement field expression, the resulting f-string will contain the expression's source, the equal sign, and the value of the expression. This is often useful for debugging::
trusted_official_docs
CPython Docs
.. versionadded:: 3.8 If a debug specifier -- an equal sign (``=``) -- appears after the replacement field expression, the resulting f-string will contain the expression's source, the equal sign, and the value of the expression. This is often useful for debugging::
.. versionadded:: 3.8 If a debug specifier -- an equal sign (``=``) -- appears after the replacement field expression, the resulting f-string will contain the expression's source, the equal sign, and the value of the expression. This is often useful for debugging::
python, official-docs, cpython, P0
Local_Trusted_Corpus
6191e0ec-d932-4a15-b0d8-cf7177e3e0af
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,712
supabase-export-v2
f6dcd1301ddb3f01
The byte length of the result must be the same as the original length. Note that all byte lengths may depend on the operating system. Cast 1D/long to 1D/unsigned bytes::
trusted_official_docs
CPython Docs
The byte length of the result must be the same as the original length. Note that all byte lengths may depend on the operating system. Cast 1D/long to 1D/unsigned bytes::
The byte length of the result must be the same as the original length. Note that all byte lengths may depend on the operating system. Cast 1D/long to 1D/unsigned bytes::
python, official-docs, cpython, P0
Local_Trusted_Corpus
61da76e9-9346-4e3d-a19a-bd30db9a80ec
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,385
supabase-export-v2
5ab78fda3ef7e277
If *n* is negative, index from the end and take the first :func:`len` plus *n* bytes. If *n* is out of bounds, raise :exc:`IndexError`. Taking less than the full length will leave remaining bytes in the :class:`bytearray`, which requires a copy. If the remaining bytes should be discarded, use :func:`~bytearray.resize...
trusted_official_docs
CPython Docs
If *n* is negative, index from the end and take the first :func:`len` plus *n* bytes. If *n* is out of bounds, raise :exc:`IndexError`. Taking less than the full length will leave remaining bytes in the :class:`bytearray`, which requires a copy. If the remaining bytes should be discarded, use :func:`~bytearray.resize...
If *n* is negative, index from the end and take the first :func:`len` plus *n* bytes. If *n* is out of bounds, raise :exc:`IndexError`. Taking less than the full length will leave remaining bytes in the :class:`bytearray`, which requires a copy. If the remaining bytes should be discarded, use :func:`~bytearray.resize...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6323f5f2-0edf-41d9-9df7-85f7f2ac4ec8
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,322
supabase-export-v2
cab9a44c01d78853
.. index:: pair: object; bytes pair: object; bytearray pair: object; memoryview pair: module; array The core built-in types for manipulating binary data are :class:`bytes` and :class:`bytearray`. They are supported by :class:`memoryview` which uses the :ref:`buffer protocol <bufferobjects>` to access the memory of othe...
trusted_official_docs
CPython Docs
.. index:: pair: object; bytes pair: object; bytearray pair: object; memoryview pair: module; array The core built-in types for manipulating binary data are :class:`bytes` and :class:`bytearray`. They are supported by :class:`memoryview` which uses the :ref:`buffer protocol <bufferobjects>` to access the memory of othe...
.. index:: pair: object; bytes pair: object; bytearray pair: object; memoryview pair: module; array The core built-in types for manipulating binary data are :class:`bytes` and :class:`bytearray`. They are supported by :class:`memoryview` which uses the :ref:`buffer protocol <bufferobjects>` to access the memory of othe...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6399d136-1f94-417f-a254-3ccc77bce343
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,439
supabase-export-v2
2e5669f148442db2
.. note:: The :meth:`~bytes.find` method should 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::
trusted_official_docs
CPython Docs
.. note:: The :meth:`~bytes.find` method should 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::
.. note:: The :meth:`~bytes.find` method should 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::
python, official-docs, cpython, P0
Local_Trusted_Corpus
649be596-ed4e-47b3-8687-6c06e238b0ed
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,629
supabase-export-v2
5973136cc733a874
>>> print(b'%(language)s has %(number)03d quote types.' % ... {b'language': b"Python", b"number": 2}) b'Python has 002 quote types.' In this case no ``*`` specifiers may occur in a format (since they require a sequential parameter list).
trusted_official_docs
CPython Docs
>>> print(b'%(language)s has %(number)03d quote types.' % ... {b'language': b"Python", b"number": 2}) b'Python has 002 quote types.' In this case no ``*`` specifiers may occur in a format (since they require a sequential parameter list).
>>> print(b'%(language)s has %(number)03d quote types.' % ... {b'language': b"Python", b"number": 2}) b'Python has 002 quote types.' In this case no ``*`` specifiers may occur in a format (since they require a sequential parameter list).
python, official-docs, cpython, P0
Local_Trusted_Corpus