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
fd9ddc55-66f0-4a84-a2ad-f4cd837294e5
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,501
supabase-export-v2
1ac65937d4040fde
.. method:: bytes.rsplit(sep=None, maxsplit=-1) bytearray.rsplit(sep=None, maxsplit=-1) Split the binary sequence into subsequences of the same type, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done, the *rightmost* ones. If *sep* is not specified or ``None``, any subse...
trusted_official_docs
CPython Docs
.. method:: bytes.rsplit(sep=None, maxsplit=-1) bytearray.rsplit(sep=None, maxsplit=-1) Split the binary sequence into subsequences of the same type, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done, the *rightmost* ones. If *sep* is not specified or ``None``, any subse...
.. method:: bytes.rsplit(sep=None, maxsplit=-1) bytearray.rsplit(sep=None, maxsplit=-1) Split the binary sequence into subsequences of the same type, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done, the *rightmost* ones. If *sep* is not specified or ``None``, any subse...
python, official-docs, cpython, P0
Local_Trusted_Corpus
fdb8eac3-4e6e-49a0-a19c-25d17cce718b
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,360
supabase-export-v2
8337360657160b7b
As bytearray objects are mutable, they support the :ref:`mutable <typesseq-mutable>` sequence operations in addition to the common bytes and bytearray operations described in :ref:`bytes-methods`. Also see the :ref:`bytearray <func-bytearray>` built-in.
trusted_official_docs
CPython Docs
As bytearray objects are mutable, they support the :ref:`mutable <typesseq-mutable>` sequence operations in addition to the common bytes and bytearray operations described in :ref:`bytes-methods`. Also see the :ref:`bytearray <func-bytearray>` built-in.
As bytearray objects are mutable, they support the :ref:`mutable <typesseq-mutable>` sequence operations in addition to the common bytes and bytearray operations described in :ref:`bytes-methods`. Also see the :ref:`bytearray <func-bytearray>` built-in.
python, official-docs, cpython, P0
Local_Trusted_Corpus
fdcf396d-afd4-4d58-b9d2-ea6f9fbd13ac
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,436
supabase-export-v2
835cb0f3276d632d
.. method:: bytes.find(sub[, start[, end]]) bytearray.find(sub[, start[, end]]) Return the lowest index in the data where the subsequence *sub* is found, such that *sub* is contained in the slice ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` if *sub* is no...
trusted_official_docs
CPython Docs
.. method:: bytes.find(sub[, start[, end]]) bytearray.find(sub[, start[, end]]) Return the lowest index in the data where the subsequence *sub* is found, such that *sub* is contained in the slice ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` if *sub* is no...
.. method:: bytes.find(sub[, start[, end]]) bytearray.find(sub[, start[, end]]) Return the lowest index in the data where the subsequence *sub* is found, such that *sub* is contained in the slice ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` if *sub* is no...
python, official-docs, cpython, P0
Local_Trusted_Corpus
fe19803d-3b87-4d9d-84e8-cf41ab3f69ae
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,743
supabase-export-v2
6486e8ddbd959369
Class method to return a floating-point number constructed from a number *x*. If the argument is an integer or a floating-point number, a floating-point number with the same value (within Python's floating-point precision) is returned. If the argument is outside the range of a Python float, an :exc:`OverflowError` w...
trusted_official_docs
CPython Docs
Class method to return a floating-point number constructed from a number *x*. If the argument is an integer or a floating-point number, a floating-point number with the same value (within Python's floating-point precision) is returned. If the argument is outside the range of a Python float, an :exc:`OverflowError` w...
Class method to return a floating-point number constructed from a number *x*. If the argument is an integer or a floating-point number, a floating-point number with the same value (within Python's floating-point precision) is returned. If the argument is outside the range of a Python float, an :exc:`OverflowError` w...
python, official-docs, cpython, P0
Local_Trusted_Corpus
fe19e8cb-8224-4240-9267-b97f9bc03632
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,818
supabase-export-v2
b7319c09beb3be07
Sequence Types --- :class:`list`, :class:`tuple`, :class:`range` ================================================================ There are three basic sequence types: lists, tuples, and range objects. Additional sequence types tailored for processing of :ref:`binary data <binaryseq>` and :ref:`text strings <textseq>` ...
trusted_official_docs
CPython Docs
Sequence Types --- :class:`list`, :class:`tuple`, :class:`range` ================================================================ There are three basic sequence types: lists, tuples, and range objects. Additional sequence types tailored for processing of :ref:`binary data <binaryseq>` and :ref:`text strings <textseq>` ...
Sequence Types --- :class:`list`, :class:`tuple`, :class:`range` ================================================================ There are three basic sequence types: lists, tuples, and range objects. Additional sequence types tailored for processing of :ref:`binary data <binaryseq>` and :ref:`text strings <textseq>` ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
fe3d4db3-9e0a-4b38-b730-01bf617538b3
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,430
supabase-export-v2
0d8e927355196feb
Passing the *encoding* argument to :class:`str` allows decoding any :term:`bytes-like object` directly, without needing to make a temporary :class:`!bytes` or :class:`!bytearray` object. .. versionchanged:: 3.1 Added support for keyword arguments.
trusted_official_docs
CPython Docs
Passing the *encoding* argument to :class:`str` allows decoding any :term:`bytes-like object` directly, without needing to make a temporary :class:`!bytes` or :class:`!bytearray` object. .. versionchanged:: 3.1 Added support for keyword arguments.
Passing the *encoding* argument to :class:`str` allows decoding any :term:`bytes-like object` directly, without needing to make a temporary :class:`!bytes` or :class:`!bytearray` object. .. versionchanged:: 3.1 Added support for keyword arguments.
python, official-docs, cpython, P0
Local_Trusted_Corpus
ff4c2f41-7912-44e7-848c-a1491824d9fe
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,364
supabase-export-v2
ba1e1258e3862c41
:class:`bytearray` class method returns bytearray object, decoding the given string object. The string must contain two hexadecimal digits per byte, with ASCII whitespace being ignored. >>> bytearray.fromhex('2Ef0 F1f2 ') bytearray(b'.\xf0\xf1\xf2')
trusted_official_docs
CPython Docs
:class:`bytearray` class method returns bytearray object, decoding the given string object. The string must contain two hexadecimal digits per byte, with ASCII whitespace being ignored. >>> bytearray.fromhex('2Ef0 F1f2 ') bytearray(b'.\xf0\xf1\xf2')
:class:`bytearray` class method returns bytearray object, decoding the given string object. The string must contain two hexadecimal digits per byte, with ASCII whitespace being ignored. >>> bytearray.fromhex('2Ef0 F1f2 ') bytearray(b'.\xf0\xf1\xf2')
python, official-docs, cpython, P0
Local_Trusted_Corpus
ff844164-b2ee-4516-ae64-6211bc4d589e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
22,653
supabase-export-v2
a8e8a10a3311e607
.. index:: pair: object; numeric pair: object; Boolean pair: object; integer pair: object; floating-point pair: object; complex number pair: C; language There are three distinct numeric types: :dfn:`integers`, :dfn:`floating-point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a subtype of integers. In...
trusted_official_docs
CPython Docs
.. index:: pair: object; numeric pair: object; Boolean pair: object; integer pair: object; floating-point pair: object; complex number pair: C; language There are three distinct numeric types: :dfn:`integers`, :dfn:`floating-point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a subtype of integers. In...
.. index:: pair: object; numeric pair: object; Boolean pair: object; integer pair: object; floating-point pair: object; complex number pair: C; language There are three distinct numeric types: :dfn:`integers`, :dfn:`floating-point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a subtype of integers. In...
python, official-docs, cpython, P0
Local_Trusted_Corpus
ff973373-4127-4b13-9d1a-9a0ab14cc7f1
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,200
supabase-export-v2
77801ced2af036d0
>>> ' spacious '.strip() 'spacious' >>> 'www.example.com'.strip('cmowz.') 'example' The outermost leading and trailing *chars* argument values are stripped from the string. Characters are removed from the leading end until reaching a string character that is not contained in the set of characters in *chars*. A simil...
trusted_official_docs
CPython Docs
>>> ' spacious '.strip() 'spacious' >>> 'www.example.com'.strip('cmowz.') 'example' The outermost leading and trailing *chars* argument values are stripped from the string. Characters are removed from the leading end until reaching a string character that is not contained in the set of characters in *chars*. A simil...
>>> ' spacious '.strip() 'spacious' >>> 'www.example.com'.strip('cmowz.') 'example' The outermost leading and trailing *chars* argument values are stripped from the string. Characters are removed from the leading end until reaching a string character that is not contained in the set of characters in *chars*. A simil...
python, official-docs, cpython, P0
Local_Trusted_Corpus
031f6ddf-35dc-4780-bfbe-55330ab2e77d
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,964
supabase-export-v2
fd6b8fa0961aa82d
:class:`contextlib.contextmanager` decorator, it will return a context manager implementing the necessary :meth:`~contextmanager.__enter__` and :meth:`~contextmanager.__exit__` methods, rather than the iterator produced by an undecorated generator function. Note that there is no specific slot for any of these methods i...
trusted_official_docs
CPython Docs
:class:`contextlib.contextmanager` decorator, it will return a context manager implementing the necessary :meth:`~contextmanager.__enter__` and :meth:`~contextmanager.__exit__` methods, rather than the iterator produced by an undecorated generator function. Note that there is no specific slot for any of these methods i...
:class:`contextlib.contextmanager` decorator, it will return a context manager implementing the necessary :meth:`~contextmanager.__enter__` and :meth:`~contextmanager.__exit__` methods, rather than the iterator produced by an undecorated generator function. Note that there is no specific slot for any of these methods i...
python, official-docs, cpython, P0
Local_Trusted_Corpus
06c79d72-9ae2-41fe-a662-0d1509c975c6
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,986
supabase-export-v2
f3f3105c09dc3eb2
The builtin functions :func:`isinstance` and :func:`issubclass` do not accept ``GenericAlias`` types for their second argument:: >>> isinstance([1, 2], list[str]) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: isinstance() argument 2 cannot be a parameterized generic
trusted_official_docs
CPython Docs
The builtin functions :func:`isinstance` and :func:`issubclass` do not accept ``GenericAlias`` types for their second argument:: >>> isinstance([1, 2], list[str]) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: isinstance() argument 2 cannot be a parameterized generic
The builtin functions :func:`isinstance` and :func:`issubclass` do not accept ``GenericAlias`` types for their second argument:: >>> isinstance([1, 2], list[str]) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: isinstance() argument 2 cannot be a parameterized generic
python, official-docs, cpython, P0
Local_Trusted_Corpus
0828f0b6-47fd-42cb-a8f1-fa4c4f88a257
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,047
supabase-export-v2
8ff5adc6ef1cb3c6
The user-exposed type for the union object can be accessed from :class:`typing.Union` and used for :func:`isinstance` checks:: >>> import typing >>> isinstance(int | str, typing.Union) True >>> typing.Union() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot create 'typing.U...
trusted_official_docs
CPython Docs
The user-exposed type for the union object can be accessed from :class:`typing.Union` and used for :func:`isinstance` checks:: >>> import typing >>> isinstance(int | str, typing.Union) True >>> typing.Union() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot create 'typing.U...
The user-exposed type for the union object can be accessed from :class:`typing.Union` and used for :func:`isinstance` checks:: >>> import typing >>> isinstance(int | str, typing.Union) True >>> typing.Union() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot create 'typing.U...
python, official-docs, cpython, P0
Local_Trusted_Corpus
090603a0-a4fc-437a-873c-d0f5e4823191
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,130
supabase-export-v2
0e082a175507f9e3
Limiting conversion size offers a practical way to avoid :cve:`2020-10735`. The limit is applied to the number of digit characters in the input or output string when a non-linear conversion algorithm would be involved. Underscores and the sign are not counted towards the limit.
trusted_official_docs
CPython Docs
Limiting conversion size offers a practical way to avoid :cve:`2020-10735`. The limit is applied to the number of digit characters in the input or output string when a non-linear conversion algorithm would be involved. Underscores and the sign are not counted towards the limit.
Limiting conversion size offers a practical way to avoid :cve:`2020-10735`. The limit is applied to the number of digit characters in the input or output string when a non-linear conversion algorithm would be involved. Underscores and the sign are not counted towards the limit.
python, official-docs, cpython, P0
Local_Trusted_Corpus
0a3dae39-c010-4a58-af55-aa2a939bb0c6
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,046
supabase-export-v2
95d46f77b5095608
list[int]) # short-circuit evaluation True >>> isinstance([1], int | list[int]) Traceback (most recent call last): ... TypeError: isinstance() argument 2 cannot be a parameterized generic The user-exposed type for the union object can be accessed from :class:`typing.Union` and used for :func:`isinstance` checks::
trusted_official_docs
CPython Docs
list[int]) # short-circuit evaluation True >>> isinstance([1], int | list[int]) Traceback (most recent call last): ... TypeError: isinstance() argument 2 cannot be a parameterized generic The user-exposed type for the union object can be accessed from :class:`typing.Union` and used for :func:`isinstance` checks::
list[int]) # short-circuit evaluation True >>> isinstance([1], int | list[int]) Traceback (most recent call last): ... TypeError: isinstance() argument 2 cannot be a parameterized generic The user-exposed type for the union object can be accessed from :class:`typing.Union` and used for :func:`isinstance` checks::
python, official-docs, cpython, P0
Local_Trusted_Corpus
0a557531-ddf7-4bd7-8d10-62bf08527bfe
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,146
supabase-export-v2
df0fa317fdb37254
are set, the ``-X`` option takes precedence. A value of *-1* indicates that both were unset, thus a value of :data:`sys.int_info.default_max_str_digits` was used during initialization. From code, you can inspect the current limit and set a new one using these :mod:`sys` APIs:
trusted_official_docs
CPython Docs
are set, the ``-X`` option takes precedence. A value of *-1* indicates that both were unset, thus a value of :data:`sys.int_info.default_max_str_digits` was used during initialization. From code, you can inspect the current limit and set a new one using these :mod:`sys` APIs:
are set, the ``-X`` option takes precedence. A value of *-1* indicates that both were unset, thus a value of :data:`sys.int_info.default_max_str_digits` was used during initialization. From code, you can inspect the current limit and set a new one using these :mod:`sys` APIs:
python, official-docs, cpython, P0
Local_Trusted_Corpus
0d406cce-bc8c-46b8-bc14-a53abbde3c83
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,161
supabase-export-v2
0320b0fba48042db
.. [2] As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, and similarly for tuples. .. [3] They must have since the parser can't tell the type of the operands.
trusted_official_docs
CPython Docs
.. [2] As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, and similarly for tuples. .. [3] They must have since the parser can't tell the type of the operands.
.. [2] As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, and similarly for tuples. .. [3] They must have since the parser can't tell the type of the operands.
python, official-docs, cpython, P0
Local_Trusted_Corpus
0e28f744-6b8d-4b31-af0e-6d9642bd940a
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,975
supabase-export-v2
ca4634a56957aa16
A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, implementing *parameterized generics*. For a container class, the argument(s) supplied to a :ref:`subscription <subscriptions>` of the class may indicate the type(s) of the elements an object contains. For example, ``set[bytes]`` can be used in type ...
trusted_official_docs
CPython Docs
A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, implementing *parameterized generics*. For a container class, the argument(s) supplied to a :ref:`subscription <subscriptions>` of the class may indicate the type(s) of the elements an object contains. For example, ``set[bytes]`` can be used in type ...
A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, implementing *parameterized generics*. For a container class, the argument(s) supplied to a :ref:`subscription <subscriptions>` of the class may indicate the type(s) of the elements an object contains. For example, ``set[bytes]`` can be used in type ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0f660a38-d24e-47ea-84ce-35dad27fb01e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,879
supabase-export-v2
d7028034050a832e
.. method:: get(key, default=None, /) Return the value for *key* if *key* is in the dictionary, else *default*. If *default* is not given, it defaults to ``None``, so that this method never raises a :exc:`KeyError`.
trusted_official_docs
CPython Docs
.. method:: get(key, default=None, /) Return the value for *key* if *key* is in the dictionary, else *default*. If *default* is not given, it defaults to ``None``, so that this method never raises a :exc:`KeyError`.
.. method:: get(key, default=None, /) Return the value for *key* if *key* is in the dictionary, else *default*. If *default* is not given, it defaults to ``None``, so that this method never raises a :exc:`KeyError`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
0f8df76a-7473-40e7-a24e-c3b77571dfbd
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,080
supabase-export-v2
d1f7385f69656d84
Code objects are returned by the built-in :func:`compile` function and can be extracted from function objects through their :attr:`~function.__code__` attribute. See also the :mod:`code` module. Accessing :attr:`~function.__code__` raises an :ref:`auditing event <auditing>` ``object.__getattr__`` with arguments ``obj``...
trusted_official_docs
CPython Docs
Code objects are returned by the built-in :func:`compile` function and can be extracted from function objects through their :attr:`~function.__code__` attribute. See also the :mod:`code` module. Accessing :attr:`~function.__code__` raises an :ref:`auditing event <auditing>` ``object.__getattr__`` with arguments ``obj``...
Code objects are returned by the built-in :func:`compile` function and can be extracted from function objects through their :attr:`~function.__code__` attribute. See also the :mod:`code` module. Accessing :attr:`~function.__code__` raises an :ref:`auditing event <auditing>` ``object.__getattr__`` with arguments ``obj``...
python, official-docs, cpython, P0
Local_Trusted_Corpus
10de1d31-4c40-4821-a145-95fde2c47433
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,133
supabase-export-v2
52b03d316481daf8
.. doctest:: >>> import sys >>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default. >>> _ = int('2' * 5432) Traceback (most recent call last): ... ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has 5432 digits; use sys.set_int_max_str_digits() to increase the limit...
trusted_official_docs
CPython Docs
.. doctest:: >>> import sys >>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default. >>> _ = int('2' * 5432) Traceback (most recent call last): ... ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has 5432 digits; use sys.set_int_max_str_digits() to increase the limit...
.. doctest:: >>> import sys >>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default. >>> _ = int('2' * 5432) Traceback (most recent call last): ... ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has 5432 digits; use sys.set_int_max_str_digits() to increase the limit...
python, official-docs, cpython, P0
Local_Trusted_Corpus
12581fdd-0061-4e33-80de-96631033192f
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,024
supabase-export-v2
1012982c11f5966c
:ref:`type objects <bltin-type-objects>`. These types are intended primarily for :term:`type annotations <annotation>`. The union type expression enables cleaner type hinting syntax compared to subscripting :class:`typing.Union`. .. describe:: X | Y | ...
trusted_official_docs
CPython Docs
:ref:`type objects <bltin-type-objects>`. These types are intended primarily for :term:`type annotations <annotation>`. The union type expression enables cleaner type hinting syntax compared to subscripting :class:`typing.Union`. .. describe:: X | Y | ...
:ref:`type objects <bltin-type-objects>`. These types are intended primarily for :term:`type annotations <annotation>`. The union type expression enables cleaner type hinting syntax compared to subscripting :class:`typing.Union`. .. describe:: X | Y | ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
168a970f-43fa-4ab5-a239-3648485cb6fa
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,774
supabase-export-v2
a964546d18ef5a97
be :term:`hashable`. To represent sets of sets, the inner sets must be :class:`frozenset` objects. If *iterable* is not specified, a new empty set is returned. Sets can be created by several means:
trusted_official_docs
CPython Docs
be :term:`hashable`. To represent sets of sets, the inner sets must be :class:`frozenset` objects. If *iterable* is not specified, a new empty set is returned. Sets can be created by several means:
be :term:`hashable`. To represent sets of sets, the inner sets must be :class:`frozenset` objects. If *iterable* is not specified, a new empty set is returned. Sets can be created by several means:
python, official-docs, cpython, P0
Local_Trusted_Corpus
17b335e6-d076-4326-bede-765a48f95438
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,936
supabase-export-v2
33265a12902aba3d
>>> # iteration >>> n = 0 >>> for val in values: ... n += val ... >>> print(n) 504 >>> # keys and values are iterated over in the same order (insertion order) >>> list(keys) ['eggs', 'sausage', 'bacon', 'spam'] >>> list(values) [2, 1, 1, 500]
trusted_official_docs
CPython Docs
>>> # iteration >>> n = 0 >>> for val in values: ... n += val ... >>> print(n) 504 >>> # keys and values are iterated over in the same order (insertion order) >>> list(keys) ['eggs', 'sausage', 'bacon', 'spam'] >>> list(values) [2, 1, 1, 500]
>>> # iteration >>> n = 0 >>> for val in values: ... n += val ... >>> print(n) 504 >>> # keys and values are iterated over in the same order (insertion order) >>> list(keys) ['eggs', 'sausage', 'bacon', 'spam'] >>> list(values) [2, 1, 1, 500]
python, official-docs, cpython, P0
Local_Trusted_Corpus
17fbdb31-2f34-4f36-b46b-fd316be6e81e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,889
supabase-export-v2
099c6e8874d806fd
:meth:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :meth:`popitem` raises a :exc:`KeyError`. .. versionchanged:: 3.7 LIFO order is now guaranteed. In prior versions, :meth:`popitem` would return an arbitrary key/value pair.
trusted_official_docs
CPython Docs
:meth:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :meth:`popitem` raises a :exc:`KeyError`. .. versionchanged:: 3.7 LIFO order is now guaranteed. In prior versions, :meth:`popitem` would return an arbitrary key/value pair.
:meth:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :meth:`popitem` raises a :exc:`KeyError`. .. versionchanged:: 3.7 LIFO order is now guaranteed. In prior versions, :meth:`popitem` would return an arbitrary key/value pair.
python, official-docs, cpython, P0
Local_Trusted_Corpus
1809e998-c4b3-4edd-9c61-3f5735811bff
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,149
supabase-export-v2
808985310ea8c93c
Information about the default and minimum can be found in :data:`sys.int_info`: * :data:`sys.int_info.default_max_str_digits <sys.int_info>` is the compiled-in default limit. * :data:`sys.int_info.str_digits_check_threshold <sys.int_info>` is the lowest accepted value for the limit (other than 0 which disables it).
trusted_official_docs
CPython Docs
Information about the default and minimum can be found in :data:`sys.int_info`: * :data:`sys.int_info.default_max_str_digits <sys.int_info>` is the compiled-in default limit. * :data:`sys.int_info.str_digits_check_threshold <sys.int_info>` is the lowest accepted value for the limit (other than 0 which disables it).
Information about the default and minimum can be found in :data:`sys.int_info`: * :data:`sys.int_info.default_max_str_digits <sys.int_info>` is the compiled-in default limit. * :data:`sys.int_info.str_digits_check_threshold <sys.int_info>` is the lowest accepted value for the limit (other than 0 which disables it).
python, official-docs, cpython, P0
Local_Trusted_Corpus
1a5270bc-1d1b-430b-9457-ba45d70b9bf3
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,134
supabase-export-v2
38c87a7f2bd914e9
(4300 digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit >>> len(hex(i_squared)) 7144 >>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited. The default limit is 4300 digits as provided in :data:`sys.int_info.default_max_str_digits <sys.int_info>`. The lowe...
trusted_official_docs
CPython Docs
(4300 digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit >>> len(hex(i_squared)) 7144 >>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited. The default limit is 4300 digits as provided in :data:`sys.int_info.default_max_str_digits <sys.int_info>`. The lowe...
(4300 digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit >>> len(hex(i_squared)) 7144 >>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited. The default limit is 4300 digits as provided in :data:`sys.int_info.default_max_str_digits <sys.int_info>`. The lowe...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1abf6e45-5025-4ad9-a45c-6ae479ce3bda
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,955
supabase-export-v2
04756e82d0d42c2c
the runtime context. The value returned by this method is bound to the identifier in the :keyword:`!as` clause of :keyword:`with` statements using this context manager. An example of a context manager that returns itself is a :term:`file object`. File objects return themselves from __enter__() to allow :func:`open` to ...
trusted_official_docs
CPython Docs
the runtime context. The value returned by this method is bound to the identifier in the :keyword:`!as` clause of :keyword:`with` statements using this context manager. An example of a context manager that returns itself is a :term:`file object`. File objects return themselves from __enter__() to allow :func:`open` to ...
the runtime context. The value returned by this method is bound to the identifier in the :keyword:`!as` clause of :keyword:`with` statements using this context manager. An example of a context manager that returns itself is a :term:`file object`. File objects return themselves from __enter__() to allow :func:`open` to ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1c5fe901-886f-46d1-a7e7-6ccbb1556e44
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,847
supabase-export-v2
aac3cf36c673054c
Providing keyword arguments as in the first example only works for keys that are valid Python identifiers. Otherwise, any valid keys can be used. Dictionaries preserve insertion order. Note that updating a key does not affect the order. Keys added after deletion are inserted at the end. ::
trusted_official_docs
CPython Docs
Providing keyword arguments as in the first example only works for keys that are valid Python identifiers. Otherwise, any valid keys can be used. Dictionaries preserve insertion order. Note that updating a key does not affect the order. Keys added after deletion are inserted at the end. ::
Providing keyword arguments as in the first example only works for keys that are valid Python identifiers. Otherwise, any valid keys can be used. Dictionaries preserve insertion order. Note that updating a key does not affect the order. Keys added after deletion are inserted at the end. ::
python, official-docs, cpython, P0
Local_Trusted_Corpus
1c75864c-d404-40ff-8a05-8fb845962d71
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,905
supabase-export-v2
c048cf350fc9ad79
.. describe:: d |= other Update the dictionary *d* with keys and values from *other*, which may be either a :term:`mapping` or an :term:`iterable` of key/value pairs. The values of *other* take priority when *d* and *other* share keys.
trusted_official_docs
CPython Docs
.. describe:: d |= other Update the dictionary *d* with keys and values from *other*, which may be either a :term:`mapping` or an :term:`iterable` of key/value pairs. The values of *other* take priority when *d* and *other* share keys.
.. describe:: d |= other Update the dictionary *d* with keys and values from *other*, which may be either a :term:`mapping` or an :term:`iterable` of key/value pairs. The values of *other* take priority when *d* and *other* share keys.
python, official-docs, cpython, P0
Local_Trusted_Corpus
1e1407e6-fa32-4398-a300-258b3bcdbe7f
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,001
supabase-export-v2
0a75a32a0d7709ad
The following standard library classes support parameterized generics. This list is non-exhaustive. * :class:`tuple` * :class:`list` * :class:`dict` * :class:`set` * :class:`frozendict` * :class:`frozenset` * :class:`type` * :class:`asyncio.Future` * :class:`asyncio.Task` * :class:`collections.deque` * :class:`collecti...
trusted_official_docs
CPython Docs
The following standard library classes support parameterized generics. This list is non-exhaustive. * :class:`tuple` * :class:`list` * :class:`dict` * :class:`set` * :class:`frozendict` * :class:`frozenset` * :class:`type` * :class:`asyncio.Future` * :class:`asyncio.Task` * :class:`collections.deque` * :class:`collecti...
The following standard library classes support parameterized generics. This list is non-exhaustive. * :class:`tuple` * :class:`list` * :class:`dict` * :class:`set` * :class:`frozendict` * :class:`frozenset` * :class:`type` * :class:`asyncio.Future` * :class:`asyncio.Task` * :class:`collections.deque` * :class:`collecti...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1e22996c-b5c2-4742-81ae-79bfc2c78e94
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,806
supabase-export-v2
315293c468b51fbd
of :class:`set` are compared to instances of :class:`frozenset` based on their members. For example, ``set('abc') == frozenset('abc')`` returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``. The subset and equality comparisons do not generalize to a total ordering function. For example, any two nonempt...
trusted_official_docs
CPython Docs
of :class:`set` are compared to instances of :class:`frozenset` based on their members. For example, ``set('abc') == frozenset('abc')`` returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``. The subset and equality comparisons do not generalize to a total ordering function. For example, any two nonempt...
of :class:`set` are compared to instances of :class:`frozenset` based on their members. For example, ``set('abc') == frozenset('abc')`` returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``. The subset and equality comparisons do not generalize to a total ordering function. For example, any two nonempt...
python, official-docs, cpython, P0
Local_Trusted_Corpus
20186149-f490-4765-bc21-03329afc1287
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,888
supabase-export-v2
40127005b0bdd8a0
Remove and return a ``(key, value)`` pair from the dictionary. Pairs are returned in :abbr:`LIFO (last-in, first-out)` order. :meth:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :meth:`popitem` raises a :exc:`KeyError`.
trusted_official_docs
CPython Docs
Remove and return a ``(key, value)`` pair from the dictionary. Pairs are returned in :abbr:`LIFO (last-in, first-out)` order. :meth:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :meth:`popitem` raises a :exc:`KeyError`.
Remove and return a ``(key, value)`` pair from the dictionary. Pairs are returned in :abbr:`LIFO (last-in, first-out)` order. :meth:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :meth:`popitem` raises a :exc:`KeyError`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
221e7b1d-248b-4ee9-9bb7-b91b4f28c2cd
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,928
supabase-export-v2
52a06d56ba1e9db9
Return a reverse iterator over the keys, values or items of the dictionary. The view will be iterated in reverse order of the insertion. .. versionchanged:: 3.8 Dictionary views are now reversible.
trusted_official_docs
CPython Docs
Return a reverse iterator over the keys, values or items of the dictionary. The view will be iterated in reverse order of the insertion. .. versionchanged:: 3.8 Dictionary views are now reversible.
Return a reverse iterator over the keys, values or items of the dictionary. The view will be iterated in reverse order of the insertion. .. versionchanged:: 3.8 Dictionary views are now reversible.
python, official-docs, cpython, P0
Local_Trusted_Corpus
228d4ba4-cc74-4161-bf9a-e3dd1ef56f47
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,157
supabase-export-v2
bd80baac4dab37b1
lower_bound = 4004 ... current_limit = sys.get_int_max_str_digits() ... if current_limit == 0 or current_limit > upper_bound: ... sys.set_int_max_str_digits(upper_bound) ... elif current_limit < lower_bound: ... sys.set_int_max_str_digits(lower_bound) If you need to disable it entirely, set it to ``0``.
trusted_official_docs
CPython Docs
lower_bound = 4004 ... current_limit = sys.get_int_max_str_digits() ... if current_limit == 0 or current_limit > upper_bound: ... sys.set_int_max_str_digits(upper_bound) ... elif current_limit < lower_bound: ... sys.set_int_max_str_digits(lower_bound) If you need to disable it entirely, set it to ``0``.
lower_bound = 4004 ... current_limit = sys.get_int_max_str_digits() ... if current_limit == 0 or current_limit > upper_bound: ... sys.set_int_max_str_digits(upper_bound) ... elif current_limit < lower_bound: ... sys.set_int_max_str_digits(lower_bound) If you need to disable it entirely, set it to ``0``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
22a2a870-ff68-40df-8738-dbaa702ef5f3
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,977
supabase-export-v2
3523bf6ecfbd9230
more methods defined on an object. For example, :mod:`regular expressions <re>` can be used on both the :class:`str` data type and the :class:`bytes` data type: * If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match <match-objects>` object where the return values of ``x.group(0)`` and ``x[0]`` will both...
trusted_official_docs
CPython Docs
more methods defined on an object. For example, :mod:`regular expressions <re>` can be used on both the :class:`str` data type and the :class:`bytes` data type: * If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match <match-objects>` object where the return values of ``x.group(0)`` and ``x[0]`` will both...
more methods defined on an object. For example, :mod:`regular expressions <re>` can be used on both the :class:`str` data type and the :class:`bytes` data type: * If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match <match-objects>` object where the return values of ``x.group(0)`` and ``x[0]`` will both...
python, official-docs, cpython, P0
Local_Trusted_Corpus
22cd864d-f2c8-4998-8df1-10aedaa6e44a
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,071
supabase-export-v2
0aec1bc40bda81a0
two flavors: :ref:`built-in methods <builtin-methods>` (such as :meth:`~list.append` on lists) and :ref:`class instance method <instance-methods>`. Built-in methods are described with the types that support them. If you access a method (a function defined in a class namespace) through an instance, you get a special obj...
trusted_official_docs
CPython Docs
two flavors: :ref:`built-in methods <builtin-methods>` (such as :meth:`~list.append` on lists) and :ref:`class instance method <instance-methods>`. Built-in methods are described with the types that support them. If you access a method (a function defined in a class namespace) through an instance, you get a special obj...
two flavors: :ref:`built-in methods <builtin-methods>` (such as :meth:`~list.append` on lists) and :ref:`class instance method <instance-methods>`. Built-in methods are described with the types that support them. If you access a method (a function defined in a class namespace) through an instance, you get a special obj...
python, official-docs, cpython, P0
Local_Trusted_Corpus
23d7e59c-dc00-468c-ac91-0cf17c8103d8
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,094
supabase-export-v2
13c3f91ac89b00ab
The Ellipsis Object ------------------- This object is commonly used to indicate that something is omitted. It supports no special operations. There is exactly one ellipsis object, named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces the :const:`Ellipsis` singleton.
trusted_official_docs
CPython Docs
The Ellipsis Object ------------------- This object is commonly used to indicate that something is omitted. It supports no special operations. There is exactly one ellipsis object, named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces the :const:`Ellipsis` singleton.
The Ellipsis Object ------------------- This object is commonly used to indicate that something is omitted. It supports no special operations. There is exactly one ellipsis object, named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces the :const:`Ellipsis` singleton.
python, official-docs, cpython, P0
Local_Trusted_Corpus
2871549c-54e2-4ebf-82de-3b22580e4845
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,152
supabase-export-v2
86e7dbb95dd94028
for the code. A workaround for source that contains such large constants is to convert them to ``0x`` hexadecimal form as it has no limit. Test your application thoroughly if you use a low limit. Ensure your tests run with the limit set early via the environment or flag so that it applies during startup and even duri...
trusted_official_docs
CPython Docs
for the code. A workaround for source that contains such large constants is to convert them to ``0x`` hexadecimal form as it has no limit. Test your application thoroughly if you use a low limit. Ensure your tests run with the limit set early via the environment or flag so that it applies during startup and even duri...
for the code. A workaround for source that contains such large constants is to convert them to ``0x`` hexadecimal form as it has no limit. Test your application thoroughly if you use a low limit. Ensure your tests run with the limit set early via the environment or flag so that it applies during startup and even duri...
python, official-docs, cpython, P0
Local_Trusted_Corpus
2a7c13b7-651b-41d8-a80e-7277a669e73c
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,776
supabase-export-v2
a5f124fb29b370d6
* Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}`` * Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', 'foo'])`` Instances of :class:`set` and :class:`frozenset` provide the following operations:
trusted_official_docs
CPython Docs
* Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}`` * Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', 'foo'])`` Instances of :class:`set` and :class:`frozenset` provide the following operations:
* Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}`` * Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', 'foo'])`` Instances of :class:`set` and :class:`frozenset` provide the following operations:
python, official-docs, cpython, P0
Local_Trusted_Corpus
2b8c09fe-ee6b-48aa-91e3-1047c224b65b
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,900
supabase-export-v2
d4a1bd78b40690f7
Return a new view of the dictionary's values. See the :ref:`documentation of view objects <dict-views>`. An equality comparison between one ``dict.values()`` view and another will always return ``False``. This also applies when comparing ``dict.values()`` to itself::
trusted_official_docs
CPython Docs
Return a new view of the dictionary's values. See the :ref:`documentation of view objects <dict-views>`. An equality comparison between one ``dict.values()`` view and another will always return ``False``. This also applies when comparing ``dict.values()`` to itself::
Return a new view of the dictionary's values. See the :ref:`documentation of view objects <dict-views>`. An equality comparison between one ``dict.values()`` view and another will always return ``False``. This also applies when comparing ``dict.values()`` to itself::
python, official-docs, cpython, P0
Local_Trusted_Corpus
2bdf3483-2a81-4d73-8413-979d71e1ed3b
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,129
supabase-export-v2
4d71ea7f885e49f3
algorithms for base 10 have sub-quadratic complexity. Converting a large value such as ``int('1' * 500_000)`` can take over a second on a fast CPU. Limiting conversion size offers a practical way to avoid :cve:`2020-10735`.
trusted_official_docs
CPython Docs
algorithms for base 10 have sub-quadratic complexity. Converting a large value such as ``int('1' * 500_000)`` can take over a second on a fast CPU. Limiting conversion size offers a practical way to avoid :cve:`2020-10735`.
algorithms for base 10 have sub-quadratic complexity. Converting a large value such as ``int('1' * 500_000)`` can take over a second on a fast CPU. Limiting conversion size offers a practical way to avoid :cve:`2020-10735`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
2c400f2f-3211-4392-9982-1f22cf8f273b
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,742
supabase-export-v2
a818f1678dfc59c7
the view. A memoryview can be created from exporters with arbitrary format strings, but some methods (e.g. :meth:`tolist`) are restricted to native single element formats. .. versionchanged:: 3.3 format ``'B'`` is now handled according to the struct module syntax. This means that ``memoryview(b'abc')[0] == b'abc'[0] =...
trusted_official_docs
CPython Docs
the view. A memoryview can be created from exporters with arbitrary format strings, but some methods (e.g. :meth:`tolist`) are restricted to native single element formats. .. versionchanged:: 3.3 format ``'B'`` is now handled according to the struct module syntax. This means that ``memoryview(b'abc')[0] == b'abc'[0] =...
the view. A memoryview can be created from exporters with arbitrary format strings, but some methods (e.g. :meth:`tolist`) are restricted to native single element formats. .. versionchanged:: 3.3 format ``'B'`` is now handled according to the struct module syntax. This means that ``memoryview(b'abc')[0] == b'abc'[0] =...
python, official-docs, cpython, P0
Local_Trusted_Corpus
2d7c5ffb-e78c-4277-91bf-19632fa05382
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,974
supabase-export-v2
85d04b056c4366a5
It is generally only possible to subscript a class if the class implements the special method :meth:`~object.__class_getitem__`. A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, implementing *parameterized generics*.
trusted_official_docs
CPython Docs
It is generally only possible to subscript a class if the class implements the special method :meth:`~object.__class_getitem__`. A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, implementing *parameterized generics*.
It is generally only possible to subscript a class if the class implements the special method :meth:`~object.__class_getitem__`. A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, implementing *parameterized generics*.
python, official-docs, cpython, P0
Local_Trusted_Corpus
3250100e-f64c-42cc-94f5-127c7e88c142
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,963
supabase-export-v2
c2be55ebf338864e
decimal arithmetic context. The specific types are not treated specially beyond their implementation of the context management protocol. See the :mod:`contextlib` module for some examples. Python's :term:`generator`\s and the :class:`contextlib.contextmanager` decorator provide a convenient way to implement these proto...
trusted_official_docs
CPython Docs
decimal arithmetic context. The specific types are not treated specially beyond their implementation of the context management protocol. See the :mod:`contextlib` module for some examples. Python's :term:`generator`\s and the :class:`contextlib.contextmanager` decorator provide a convenient way to implement these proto...
decimal arithmetic context. The specific types are not treated specially beyond their implementation of the context management protocol. See the :mod:`contextlib` module for some examples. Python's :term:`generator`\s and the :class:`contextlib.contextmanager` decorator provide a convenient way to implement these proto...
python, official-docs, cpython, P0
Local_Trusted_Corpus
34610170-bbaa-4486-9c8a-496c0633976f
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,151
supabase-export-v2
d56a23579bf83a2e
.. caution:: Setting a low limit *can* lead to problems. While rare, code exists that contains integer constants in decimal in their source that exceed the minimum threshold. A consequence of setting the limit is that Python source code containing decimal integer literals longer than the limit will encounter an err...
trusted_official_docs
CPython Docs
.. caution:: Setting a low limit *can* lead to problems. While rare, code exists that contains integer constants in decimal in their source that exceed the minimum threshold. A consequence of setting the limit is that Python source code containing decimal integer literals longer than the limit will encounter an err...
.. caution:: Setting a low limit *can* lead to problems. While rare, code exists that contains integer constants in decimal in their source that exceed the minimum threshold. A consequence of setting the limit is that Python source code containing decimal integer literals longer than the limit will encounter an err...
python, official-docs, cpython, P0
Local_Trusted_Corpus
36e84d4e-d7d1-462a-a220-74865dd0badb
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,877
supabase-export-v2
e073642ecc90f2e7
Create a new dictionary with keys from *iterable* and values set to *value*. :meth:`fromkeys` is a class method that returns a new dictionary. *value* defaults to ``None``. All of the values refer to just a single instance, so it generally doesn't make sense for *value* to be a mutable object such as an empty list. ...
trusted_official_docs
CPython Docs
Create a new dictionary with keys from *iterable* and values set to *value*. :meth:`fromkeys` is a class method that returns a new dictionary. *value* defaults to ``None``. All of the values refer to just a single instance, so it generally doesn't make sense for *value* to be a mutable object such as an empty list. ...
Create a new dictionary with keys from *iterable* and values set to *value*. :meth:`fromkeys` is a class method that returns a new dictionary. *value* defaults to ``None``. All of the values refer to just a single instance, so it generally doesn't make sense for *value* to be a mutable object such as an empty list. ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
376ed34d-5d4e-49d8-a6db-e6f9add610cc
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,908
supabase-export-v2
fa5293266b8dbf8b
Dictionaries and dictionary views are reversible. :: >>> d = {"one": 1, "two": 2, "three": 3, "four": 4} >>> d {'one': 1, 'two': 2, 'three': 3, 'four': 4} >>> list(reversed(d)) ['four', 'three', 'two', 'one'] >>> list(reversed(d.values())) [4, 3, 2, 1] >>> list(reversed(d.items())) [('four', 4), ('three', 3), (...
trusted_official_docs
CPython Docs
Dictionaries and dictionary views are reversible. :: >>> d = {"one": 1, "two": 2, "three": 3, "four": 4} >>> d {'one': 1, 'two': 2, 'three': 3, 'four': 4} >>> list(reversed(d)) ['four', 'three', 'two', 'one'] >>> list(reversed(d.values())) [4, 3, 2, 1] >>> list(reversed(d.items())) [('four', 4), ('three', 3), (...
Dictionaries and dictionary views are reversible. :: >>> d = {"one": 1, "two": 2, "three": 3, "four": 4} >>> d {'one': 1, 'two': 2, 'three': 3, 'four': 4} >>> list(reversed(d)) ['four', 'three', 'two', 'one'] >>> list(reversed(d.values())) [4, 3, 2, 1] >>> list(reversed(d.items())) [('four', 4), ('three', 3), (...
python, official-docs, cpython, P0
Local_Trusted_Corpus
37e6be85-2f8e-45a6-b95a-3890e570f637
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,793
supabase-export-v2
8b50ff08c725d74f
Test whether the set is a proper superset of *other*, that is, ``set >= other and set != other``. .. method:: frozenset.union(*others) set.union(*others) .. describe:: set | other | ...
trusted_official_docs
CPython Docs
Test whether the set is a proper superset of *other*, that is, ``set >= other and set != other``. .. method:: frozenset.union(*others) set.union(*others) .. describe:: set | other | ...
Test whether the set is a proper superset of *other*, that is, ``set >= other and set != other``. .. method:: frozenset.union(*others) set.union(*others) .. describe:: set | other | ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3a25185e-b2bd-41ae-8aa6-fb38f14697e6
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,773
supabase-export-v2
248985492ca700fb
.. class:: set(iterable=(), /) frozenset(iterable=(), /) Return a new set or frozenset object whose elements are taken from *iterable*. The elements of a set must be :term:`hashable`. To represent sets of sets, the inner sets must be :class:`frozenset` objects. If *iterable* is not specified, a new empty set is ret...
trusted_official_docs
CPython Docs
.. class:: set(iterable=(), /) frozenset(iterable=(), /) Return a new set or frozenset object whose elements are taken from *iterable*. The elements of a set must be :term:`hashable`. To represent sets of sets, the inner sets must be :class:`frozenset` objects. If *iterable* is not specified, a new empty set is ret...
.. class:: set(iterable=(), /) frozenset(iterable=(), /) Return a new set or frozenset object whose elements are taken from *iterable*. The elements of a set must be :term:`hashable`. To represent sets of sets, the inner sets must be :class:`frozenset` objects. If *iterable* is not specified, a new empty set is ret...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3b02c233-959a-47c8-b186-edee6f481f7e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,019
supabase-export-v2
76ea03aeffdc3c62
:pep:`484` - Type Hints Introducing Python's framework for type annotations. :pep:`585` - Type Hinting Generics In Standard Collections Introducing the ability to natively parameterize standard-library classes, provided they implement the special class method :meth:`~object.__class_getitem__`.
trusted_official_docs
CPython Docs
:pep:`484` - Type Hints Introducing Python's framework for type annotations. :pep:`585` - Type Hinting Generics In Standard Collections Introducing the ability to natively parameterize standard-library classes, provided they implement the special class method :meth:`~object.__class_getitem__`.
:pep:`484` - Type Hints Introducing Python's framework for type annotations. :pep:`585` - Type Hinting Generics In Standard Collections Introducing the ability to natively parameterize standard-library classes, provided they implement the special class method :meth:`~object.__class_getitem__`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
3c2b5af4-f1c9-4d3f-a03f-cc0298f93b97
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,943
supabase-export-v2
e02512e87297a517
Return a new frozen dictionary initialized from an optional positional argument and a possibly empty set of keyword arguments. A :class:`!frozendict` has a similar API to the :class:`dict` API, with the following differences:
trusted_official_docs
CPython Docs
Return a new frozen dictionary initialized from an optional positional argument and a possibly empty set of keyword arguments. A :class:`!frozendict` has a similar API to the :class:`dict` API, with the following differences:
Return a new frozen dictionary initialized from an optional positional argument and a possibly empty set of keyword arguments. A :class:`!frozendict` has a similar API to the :class:`dict` API, with the following differences:
python, official-docs, cpython, P0
Local_Trusted_Corpus
427d9993-e61a-4ef0-ba97-f373e91c5a23
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,025
supabase-export-v2
287785d4a557c4c1
.. describe:: X | Y | ... Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For example, the following function expects an argument of type :class:`int` or :class:`float`::
trusted_official_docs
CPython Docs
.. describe:: X | Y | ... Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For example, the following function expects an argument of type :class:`int` or :class:`float`::
.. describe:: X | Y | ... Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For example, the following function expects an argument of type :class:`int` or :class:`float`::
python, official-docs, cpython, P0
Local_Trusted_Corpus
43547e01-29c9-4168-ad05-cc8c666ffe7c
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,145
supabase-export-v2
11587d82b80b0fbc
Before Python starts up you can use an environment variable or an interpreter command line flag to configure the limit: * :envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable the limitation. * :option:`-X int_max_str_digit...
trusted_official_docs
CPython Docs
Before Python starts up you can use an environment variable or an interpreter command line flag to configure the limit: * :envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable the limitation. * :option:`-X int_max_str_digit...
Before Python starts up you can use an environment variable or an interpreter command line flag to configure the limit: * :envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable the limitation. * :option:`-X int_max_str_digit...
python, official-docs, cpython, P0
Local_Trusted_Corpus
43f67a52-794c-4edc-9c0d-400a353f0fe0
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,960
supabase-export-v2
25c6c17950cdff55
suppress the exception and continue execution with the statement immediately following the :keyword:`!with` statement. Otherwise the exception continues propagating after this method has finished executing. If this method raises an exception while handling an earlier exception from the :keyword:`with` block, the new e...
trusted_official_docs
CPython Docs
suppress the exception and continue execution with the statement immediately following the :keyword:`!with` statement. Otherwise the exception continues propagating after this method has finished executing. If this method raises an exception while handling an earlier exception from the :keyword:`with` block, the new e...
suppress the exception and continue execution with the statement immediately following the :keyword:`!with` statement. Otherwise the exception continues propagating after this method has finished executing. If this method raises an exception while handling an earlier exception from the :keyword:`with` block, the new e...
python, official-docs, cpython, P0
Local_Trusted_Corpus
449b3554-ded8-4bdd-ade4-158164b44017
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,976
supabase-export-v2
d52a715b948f3421
an object contains. For example, ``set[bytes]`` can be used in type annotations to signify a :class:`set` in which all the elements are of type :class:`bytes`. For a class which defines :meth:`~object.__class_getitem__` but is not a container, the argument(s) supplied to a subscription of the class will often indicate ...
trusted_official_docs
CPython Docs
an object contains. For example, ``set[bytes]`` can be used in type annotations to signify a :class:`set` in which all the elements are of type :class:`bytes`. For a class which defines :meth:`~object.__class_getitem__` but is not a container, the argument(s) supplied to a subscription of the class will often indicate ...
an object contains. For example, ``set[bytes]`` can be used in type annotations to signify a :class:`set` in which all the elements are of type :class:`bytes`. For a class which defines :meth:`~object.__class_getitem__` but is not a container, the argument(s) supplied to a subscription of the class will often indicate ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
461ecc6b-8fdb-47e7-9205-9edafa65d40f
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,901
supabase-export-v2
7fb54086ebbacb16
An equality comparison between one ``dict.values()`` view and another will always return ``False``. This also applies when comparing ``dict.values()`` to itself:: >>> d = {'a': 1} >>> d.values() == d.values() False
trusted_official_docs
CPython Docs
An equality comparison between one ``dict.values()`` view and another will always return ``False``. This also applies when comparing ``dict.values()`` to itself:: >>> d = {'a': 1} >>> d.values() == d.values() False
An equality comparison between one ``dict.values()`` view and another will always return ``False``. This also applies when comparing ``dict.values()`` to itself:: >>> d = {'a': 1} >>> d.values() == d.values() False
python, official-docs, cpython, P0
Local_Trusted_Corpus
47bb5d3d-1083-464c-aaaa-e945eb924378
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,805
supabase-export-v2
fd7ce089304ee671
than another set if and only if the first set is a proper superset of the second set (is a superset, but is not equal). Instances of :class:`set` are compared to instances of :class:`frozenset` based on their members. For example, ``set('abc') == frozenset('abc')`` returns ``True`` and so does ``set('abc') in set([froz...
trusted_official_docs
CPython Docs
than another set if and only if the first set is a proper superset of the second set (is a superset, but is not equal). Instances of :class:`set` are compared to instances of :class:`frozenset` based on their members. For example, ``set('abc') == frozenset('abc')`` returns ``True`` and so does ``set('abc') in set([froz...
than another set if and only if the first set is a proper superset of the second set (is a superset, but is not equal). Instances of :class:`set` are compared to instances of :class:`frozenset` based on their members. For example, ``set('abc') == frozenset('abc')`` returns ``True`` and so does ``set('abc') in set([froz...
python, official-docs, cpython, P0
Local_Trusted_Corpus
485fa1b9-a1ee-4179-9fdf-c844483b6cb9
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,028
supabase-export-v2
4d20d7a986d88189
.. note:: The ``|`` operand cannot be used at runtime to define unions where one or more members is a forward reference. For example, ``int | "Foo"``, where ``"Foo"`` is a reference to a class not yet defined, will fail at runtime. For unions which include forward references, present the whole expression as a strin...
trusted_official_docs
CPython Docs
.. note:: The ``|`` operand cannot be used at runtime to define unions where one or more members is a forward reference. For example, ``int | "Foo"``, where ``"Foo"`` is a reference to a class not yet defined, will fail at runtime. For unions which include forward references, present the whole expression as a strin...
.. note:: The ``|`` operand cannot be used at runtime to define unions where one or more members is a forward reference. For example, ``int | "Foo"``, where ``"Foo"`` is a reference to a class not yet defined, will fail at runtime. For unions which include forward references, present the whole expression as a strin...
python, official-docs, cpython, P0
Local_Trusted_Corpus
49a00851-5ef4-4bae-8c85-28013aaf389d
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,075
supabase-export-v2
9641957d88812c89
"<stdin>", line 1, in <module> AttributeError: 'method' object has no attribute 'whoami' >>> c.method.__func__.whoami = 'my name is method' >>> c.method.whoami 'my name is method' See :ref:`instance-methods` for more information.
trusted_official_docs
CPython Docs
"<stdin>", line 1, in <module> AttributeError: 'method' object has no attribute 'whoami' >>> c.method.__func__.whoami = 'my name is method' >>> c.method.whoami 'my name is method' See :ref:`instance-methods` for more information.
"<stdin>", line 1, in <module> AttributeError: 'method' object has no attribute 'whoami' >>> c.method.__func__.whoami = 'my name is method' >>> c.method.whoami 'my name is method' See :ref:`instance-methods` for more information.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4a0a0c6a-a177-492f-b890-6f93bf6353b8
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,997
supabase-export-v2
bede40cc35de5009
>>> dict[str][str] Traceback (most recent call last): ... TypeError: dict[str] is not a generic class However, such expressions are valid when :ref:`type variables <generics>` are used. The index must have as many elements as there are type variable items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`....
trusted_official_docs
CPython Docs
>>> dict[str][str] Traceback (most recent call last): ... TypeError: dict[str] is not a generic class However, such expressions are valid when :ref:`type variables <generics>` are used. The index must have as many elements as there are type variable items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`....
>>> dict[str][str] Traceback (most recent call last): ... TypeError: dict[str] is not a generic class However, such expressions are valid when :ref:`type variables <generics>` are used. The index must have as many elements as there are type variable items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`....
python, official-docs, cpython, P0
Local_Trusted_Corpus
4acadffb-f020-4ffe-8e42-af2c10e9729e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,952
supabase-export-v2
e186270fdf6abdc5
.. index:: single: context manager single: context management protocol single: protocol; context management Python's :keyword:`with` statement supports the concept of a runtime context defined by a context manager. This is implemented using a pair of methods that allow user-defined classes to define a runtime context t...
trusted_official_docs
CPython Docs
.. index:: single: context manager single: context management protocol single: protocol; context management Python's :keyword:`with` statement supports the concept of a runtime context defined by a context manager. This is implemented using a pair of methods that allow user-defined classes to define a runtime context t...
.. index:: single: context manager single: context management protocol single: protocol; context management Python's :keyword:`with` statement supports the concept of a runtime context defined by a context manager. This is implemented using a pair of methods that allow user-defined classes to define a runtime context t...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4d5b26e4-511d-4924-83e7-ee7623a161af
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,957
supabase-export-v2
4cb3c4f2e5d78e24
This allows changes to be made to the current decimal context in the body of the :keyword:`with` statement without affecting code outside the :keyword:`!with` statement. .. method:: contextmanager.__exit__(exc_type, exc_val, exc_tb)
trusted_official_docs
CPython Docs
This allows changes to be made to the current decimal context in the body of the :keyword:`with` statement without affecting code outside the :keyword:`!with` statement. .. method:: contextmanager.__exit__(exc_type, exc_val, exc_tb)
This allows changes to be made to the current decimal context in the body of the :keyword:`with` statement without affecting code outside the :keyword:`!with` statement. .. method:: contextmanager.__exit__(exc_type, exc_val, exc_tb)
python, official-docs, cpython, P0
Local_Trusted_Corpus
4d5edbdb-33d4-4a11-9e38-c9aff6f7892e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,771
supabase-export-v2
ff386c9a632e77c6
sets (not frozensets) can be created by placing a comma-separated list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in addition to the :class:`set` constructor. The constructors for both classes work the same:
trusted_official_docs
CPython Docs
sets (not frozensets) can be created by placing a comma-separated list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in addition to the :class:`set` constructor. The constructors for both classes work the same:
sets (not frozensets) can be created by placing a comma-separated list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in addition to the :class:`set` constructor. The constructors for both classes work the same:
python, official-docs, cpython, P0
Local_Trusted_Corpus
4dd6fb08-4587-4ce8-acfe-a4bbdac194c6
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,954
supabase-export-v2
a3121eb9900c4adc
.. method:: contextmanager.__enter__() Enter the runtime context and return either this object or another object related to the runtime context. The value returned by this method is bound to the identifier in the :keyword:`!as` clause of :keyword:`with` statements using this context manager.
trusted_official_docs
CPython Docs
.. method:: contextmanager.__enter__() Enter the runtime context and return either this object or another object related to the runtime context. The value returned by this method is bound to the identifier in the :keyword:`!as` clause of :keyword:`with` statements using this context manager.
.. method:: contextmanager.__enter__() Enter the runtime context and return either this object or another object related to the runtime context. The value returned by this method is bound to the identifier in the :keyword:`!as` clause of :keyword:`with` statements using this context manager.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4edba112-33e1-4a53-b778-660108551e3c
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,082
supabase-export-v2
67f51f0629878f12
.. index:: pair: built-in function; exec pair: built-in function; eval A code object can be executed or evaluated by passing it (instead of a source string) to the :func:`exec` or :func:`eval` built-in functions.
trusted_official_docs
CPython Docs
.. index:: pair: built-in function; exec pair: built-in function; eval A code object can be executed or evaluated by passing it (instead of a source string) to the :func:`exec` or :func:`eval` built-in functions.
.. index:: pair: built-in function; exec pair: built-in function; eval A code object can be executed or evaluated by passing it (instead of a source string) to the :func:`exec` or :func:`eval` built-in functions.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4f5de032-4ea6-4bac-9469-9fa97586b604
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,885
supabase-export-v2
a15e8c92686686c2
.. method:: pop(key, /) pop(key, default, /) If *key* is in the dictionary, remove it and return its value, else return *default*. If *default* is not given and *key* is not in the dictionary, a :exc:`KeyError` is raised.
trusted_official_docs
CPython Docs
.. method:: pop(key, /) pop(key, default, /) If *key* is in the dictionary, remove it and return its value, else return *default*. If *default* is not given and *key* is not in the dictionary, a :exc:`KeyError` is raised.
.. method:: pop(key, /) pop(key, default, /) If *key* is in the dictionary, remove it and return its value, else return *default*. If *default* is not given and *key* is not in the dictionary, a :exc:`KeyError` is raised.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4f975e1a-0b88-44fc-9996-f5cc0facd0b0
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,162
supabase-export-v2
7c206362e9c71462
.. [3] They must have since the parser can't tell the type of the operands. .. [4] Cased characters are those with general category property being one of "Lu" (Letter, uppercase), "Ll" (Letter, lowercase), or "Lt" (Letter, titlecase).
trusted_official_docs
CPython Docs
.. [3] They must have since the parser can't tell the type of the operands. .. [4] Cased characters are those with general category property being one of "Lu" (Letter, uppercase), "Ll" (Letter, lowercase), or "Lt" (Letter, titlecase).
.. [3] They must have since the parser can't tell the type of the operands. .. [4] Cased characters are those with general category property being one of "Lu" (Letter, uppercase), "Ll" (Letter, lowercase), or "Lt" (Letter, titlecase).
python, official-docs, cpython, P0
Local_Trusted_Corpus
4fc1f48c-765f-4828-bd31-5a32c4f78312
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,107
supabase-export-v2
001c5223d9d74266
are asked to operate on types they don't support. See :ref:`comparisons` for more information. There is exactly one :data:`NotImplemented` object. :code:`type(NotImplemented)()` produces the singleton instance. It is written as :code:`NotImplemented`.
trusted_official_docs
CPython Docs
are asked to operate on types they don't support. See :ref:`comparisons` for more information. There is exactly one :data:`NotImplemented` object. :code:`type(NotImplemented)()` produces the singleton instance. It is written as :code:`NotImplemented`.
are asked to operate on types they don't support. See :ref:`comparisons` for more information. There is exactly one :data:`NotImplemented` object. :code:`type(NotImplemented)()` produces the singleton instance. It is written as :code:`NotImplemented`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4fff1e3b-6de9-4e9d-acde-737ed709ba2d
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,939
supabase-export-v2
bd9dce1724fc2e32
'bacon', 'salad'} {'bacon'} >>> keys ^ {'sausage', 'juice'} == {'juice', 'sausage', 'bacon', 'spam'} True >>> keys | ['juice', 'juice', 'juice'] == {'bacon', 'spam', 'juice'} True >>> # get back a read-only proxy for the original dictionary >>> values.mapping mappingproxy({'bacon': 1, 'spam': 500}) >>> values.mappin...
trusted_official_docs
CPython Docs
'bacon', 'salad'} {'bacon'} >>> keys ^ {'sausage', 'juice'} == {'juice', 'sausage', 'bacon', 'spam'} True >>> keys | ['juice', 'juice', 'juice'] == {'bacon', 'spam', 'juice'} True >>> # get back a read-only proxy for the original dictionary >>> values.mapping mappingproxy({'bacon': 1, 'spam': 500}) >>> values.mappin...
'bacon', 'salad'} {'bacon'} >>> keys ^ {'sausage', 'juice'} == {'juice', 'sausage', 'bacon', 'spam'} True >>> keys | ['juice', 'juice', 'juice'] == {'bacon', 'spam', 'juice'} True >>> # get back a read-only proxy for the original dictionary >>> values.mapping mappingproxy({'bacon': 1, 'spam': 500}) >>> values.mappin...
python, official-docs, cpython, P0
Local_Trusted_Corpus
506538f1-d3bc-49ce-b820-bd54662407c0
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,837
supabase-export-v2
1971dfd98ec79982
are currently two standard mapping types, the :dfn:`dictionary` and :class:`frozendict`. (For other containers see the built-in :class:`list`, :class:`set`, and :class:`tuple` classes, and the :mod:`collections` module.) A dictionary's keys are *almost* arbitrary values. Values that are not :term:`hashable`, that is, v...
trusted_official_docs
CPython Docs
are currently two standard mapping types, the :dfn:`dictionary` and :class:`frozendict`. (For other containers see the built-in :class:`list`, :class:`set`, and :class:`tuple` classes, and the :mod:`collections` module.) A dictionary's keys are *almost* arbitrary values. Values that are not :term:`hashable`, that is, v...
are currently two standard mapping types, the :dfn:`dictionary` and :class:`frozendict`. (For other containers see the built-in :class:`list`, :class:`set`, and :class:`tuple` classes, and the :mod:`collections` module.) A dictionary's keys are *almost* arbitrary values. Values that are not :term:`hashable`, that is, v...
python, official-docs, cpython, P0
Local_Trusted_Corpus
51b6e270-fd13-4e49-a4a5-cc70c97a0690
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,878
supabase-export-v2
a524d364a4517342
doesn't make sense for *value* to be a mutable object such as an empty list. To get distinct values, use a :ref:`dict comprehension <dict>` instead. .. method:: get(key, default=None, /)
trusted_official_docs
CPython Docs
doesn't make sense for *value* to be a mutable object such as an empty list. To get distinct values, use a :ref:`dict comprehension <dict>` instead. .. method:: get(key, default=None, /)
doesn't make sense for *value* to be a mutable object such as an empty list. To get distinct values, use a :ref:`dict comprehension <dict>` instead. .. method:: get(key, default=None, /)
python, official-docs, cpython, P0
Local_Trusted_Corpus
5514cc7b-73c4-4416-8a28-4bb462f9ca95
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,809
supabase-export-v2
e7a3875886a61931
Set elements, like dictionary keys, must be :term:`hashable`. Binary operations that mix :class:`set` instances with :class:`frozenset` return the type of the first operand. For example: ``frozenset('ab') | set('bc')`` returns an instance of :class:`frozenset`.
trusted_official_docs
CPython Docs
Set elements, like dictionary keys, must be :term:`hashable`. Binary operations that mix :class:`set` instances with :class:`frozenset` return the type of the first operand. For example: ``frozenset('ab') | set('bc')`` returns an instance of :class:`frozenset`.
Set elements, like dictionary keys, must be :term:`hashable`. Binary operations that mix :class:`set` instances with :class:`frozenset` return the type of the first operand. For example: ``frozenset('ab') | set('bc')`` returns an instance of :class:`frozenset`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
58185c0d-502b-41cc-b22e-3f0ee62635a7
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,113
supabase-export-v2
70560ed43d83dc4a
Special Attributes ================== The implementation adds a few special read-only attributes to several object types, where they are relevant. Some of these are not reported by the :func:`dir` built-in function.
trusted_official_docs
CPython Docs
Special Attributes ================== The implementation adds a few special read-only attributes to several object types, where they are relevant. Some of these are not reported by the :func:`dir` built-in function.
Special Attributes ================== The implementation adds a few special read-only attributes to several object types, where they are relevant. Some of these are not reported by the :func:`dir` built-in function.
python, official-docs, cpython, P0
Local_Trusted_Corpus
58fa3818-5fda-4d88-b610-435fbed0418c
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,789
supabase-export-v2
e12b331d950fb48a
Test whether the set is a proper subset of *other*, that is, ``set <= other and set != other``. .. method:: frozenset.issuperset(other, /) set.issuperset(other, /) .. describe:: set >= other
trusted_official_docs
CPython Docs
Test whether the set is a proper subset of *other*, that is, ``set <= other and set != other``. .. method:: frozenset.issuperset(other, /) set.issuperset(other, /) .. describe:: set >= other
Test whether the set is a proper subset of *other*, that is, ``set <= other and set != other``. .. method:: frozenset.issuperset(other, /) set.issuperset(other, /) .. describe:: set >= other
python, official-docs, cpython, P0
Local_Trusted_Corpus
5b4c8be7-6a6e-43a3-a7e7-fc0263584652
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,087
supabase-export-v2
6e0d8cb7e2d99aeb
is accessed by the built-in function :func:`type`. There are no special operations on types. The standard module :mod:`types` defines names for all standard built-in types. Types are written like this: ``<class 'int'>``.
trusted_official_docs
CPython Docs
is accessed by the built-in function :func:`type`. There are no special operations on types. The standard module :mod:`types` defines names for all standard built-in types. Types are written like this: ``<class 'int'>``.
is accessed by the built-in function :func:`type`. There are no special operations on types. The standard module :mod:`types` defines names for all standard built-in types. Types are written like this: ``<class 'int'>``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5d05d7d7-69ed-42af-9f50-c29cd8cb7c53
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,719
supabase-export-v2
e2657de6f8895f22
Cast 1D/unsigned long to 2D/unsigned long:: >>> buf = struct.pack("L"*6, *list(range(6))) >>> x = memoryview(buf) >>> y = x.cast('L', shape=[2,3]) >>> len(y) 2 >>> y.nbytes 48 >>> y.tolist() [[0, 1, 2], [3, 4, 5]]
trusted_official_docs
CPython Docs
Cast 1D/unsigned long to 2D/unsigned long:: >>> buf = struct.pack("L"*6, *list(range(6))) >>> x = memoryview(buf) >>> y = x.cast('L', shape=[2,3]) >>> len(y) 2 >>> y.nbytes 48 >>> y.tolist() [[0, 1, 2], [3, 4, 5]]
Cast 1D/unsigned long to 2D/unsigned long:: >>> buf = struct.pack("L"*6, *list(range(6))) >>> x = memoryview(buf) >>> y = x.cast('L', shape=[2,3]) >>> len(y) 2 >>> y.nbytes 48 >>> y.tolist() [[0, 1, 2], [3, 4, 5]]
python, official-docs, cpython, P0
Local_Trusted_Corpus
5f316ef4-80a4-4b8e-92b2-8f181d636eeb
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,843
supabase-export-v2
a91178fd6937388b
element the corresponding value. If a key occurs more than once, the last value for that key becomes the corresponding value in the new dictionary. If keyword arguments are given, the keyword arguments and their values are added to the dictionary created from the positional argument. If a key being added is already p...
trusted_official_docs
CPython Docs
element the corresponding value. If a key occurs more than once, the last value for that key becomes the corresponding value in the new dictionary. If keyword arguments are given, the keyword arguments and their values are added to the dictionary created from the positional argument. If a key being added is already p...
element the corresponding value. If a key occurs more than once, the last value for that key becomes the corresponding value in the new dictionary. If keyword arguments are given, the keyword arguments and their values are added to the dictionary created from the positional argument. If a key being added is already p...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5fdc5907-a57c-4982-bbf1-a4b8f3363856
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,937
supabase-export-v2
2f3d6b0b2f1dbd11
# keys and values are iterated over in the same order (insertion order) >>> list(keys) ['eggs', 'sausage', 'bacon', 'spam'] >>> list(values) [2, 1, 1, 500] >>> # view objects are dynamic and reflect dict changes >>> del dishes['eggs'] >>> del dishes['sausage'] >>> list(keys) ['bacon', 'spam']
trusted_official_docs
CPython Docs
# keys and values are iterated over in the same order (insertion order) >>> list(keys) ['eggs', 'sausage', 'bacon', 'spam'] >>> list(values) [2, 1, 1, 500] >>> # view objects are dynamic and reflect dict changes >>> del dishes['eggs'] >>> del dishes['sausage'] >>> list(keys) ['bacon', 'spam']
# keys and values are iterated over in the same order (insertion order) >>> list(keys) ['eggs', 'sausage', 'bacon', 'spam'] >>> list(values) [2, 1, 1, 500] >>> # view objects are dynamic and reflect dict changes >>> del dishes['eggs'] >>> del dishes['sausage'] >>> list(keys) ['bacon', 'spam']
python, official-docs, cpython, P0
Local_Trusted_Corpus
62ff43c2-0797-428e-949d-5f03b22d70ca
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,074
supabase-export-v2
4834c3be0987c5ad
.. doctest:: >>> class C: ... def method(self): ... pass ... >>> c = C() >>> c.method.whoami = 'my name is method' # can't set on the method Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'method' object has no attribute 'whoami' >>> c.method.__func__.whoami = 'my name is...
trusted_official_docs
CPython Docs
.. doctest:: >>> class C: ... def method(self): ... pass ... >>> c = C() >>> c.method.whoami = 'my name is method' # can't set on the method Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'method' object has no attribute 'whoami' >>> c.method.__func__.whoami = 'my name is...
.. doctest:: >>> class C: ... def method(self): ... pass ... >>> c = C() >>> c.method.whoami = 'my name is method' # can't set on the method Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'method' object has no attribute 'whoami' >>> c.method.__func__.whoami = 'my name is...
python, official-docs, cpython, P0
Local_Trusted_Corpus
636e0f61-7fe3-414f-90e9-d513f4576f78
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,775
supabase-export-v2
8d511e3068c35e1e
Sets can be created by several means: * Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}`` * Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}`` * Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', 'foo'])``
trusted_official_docs
CPython Docs
Sets can be created by several means: * Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}`` * Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}`` * Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', 'foo'])``
Sets can be created by several means: * Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}`` * Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}`` * Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', 'foo'])``
python, official-docs, cpython, P0
Local_Trusted_Corpus
63d1b4ba-ede4-4c2e-b1f8-56ba7085ba3e
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,860
supabase-export-v2
541a0d9bbd307f75
>>> class Counter(dict): ... def __missing__(self, key): ... return 0 ... >>> c = Counter() >>> c['red'] 0 >>> c['red'] += 1 >>> c['red'] 1 The example above shows part of the implementation of :class:`collections.Counter`. A different :meth:`!__missing__` method is used by :class:`collections.defaultdict`.
trusted_official_docs
CPython Docs
>>> class Counter(dict): ... def __missing__(self, key): ... return 0 ... >>> c = Counter() >>> c['red'] 0 >>> c['red'] += 1 >>> c['red'] 1 The example above shows part of the implementation of :class:`collections.Counter`. A different :meth:`!__missing__` method is used by :class:`collections.defaultdict`.
>>> class Counter(dict): ... def __missing__(self, key): ... return 0 ... >>> c = Counter() >>> c['red'] 0 >>> c['red'] += 1 >>> c['red'] 1 The example above shows part of the implementation of :class:`collections.Counter`. A different :meth:`!__missing__` method is used by :class:`collections.defaultdict`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
666cddaf-802e-41c2-a869-3993acbe600c
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,091
supabase-export-v2
5080d2305b020d28
explicitly return a value. It supports no special operations. There is exactly one null object, named ``None`` (a built-in name). ``type(None)()`` produces the same singleton. It is written as ``None``.
trusted_official_docs
CPython Docs
explicitly return a value. It supports no special operations. There is exactly one null object, named ``None`` (a built-in name). ``type(None)()`` produces the same singleton. It is written as ``None``.
explicitly return a value. It supports no special operations. There is exactly one null object, named ``None`` (a built-in name). ``type(None)()`` produces the same singleton. It is written as ``None``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
67352c25-5d7b-4a78-ab2f-d836c31344a9
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,984
supabase-export-v2
31038963d64e50a2
the key type and the value type. In this example, the function expects a ``dict`` with keys of type :class:`str` and values of type :class:`int`:: def send_post_request(url: str, body: dict[str, int]) -> None: ...
trusted_official_docs
CPython Docs
the key type and the value type. In this example, the function expects a ``dict`` with keys of type :class:`str` and values of type :class:`int`:: def send_post_request(url: str, body: dict[str, int]) -> None: ...
the key type and the value type. In this example, the function expects a ``dict`` with keys of type :class:`str` and values of type :class:`int`:: def send_post_request(url: str, body: dict[str, int]) -> None: ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6878ccd1-b792-4071-9bdf-f2c02cfc82fb
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,160
supabase-export-v2
473412c4a4214669
.. [1] Additional information on these special methods may be found in the Python Reference Manual (:ref:`customization`). .. [2] As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, and similarly for tuples.
trusted_official_docs
CPython Docs
.. [1] Additional information on these special methods may be found in the Python Reference Manual (:ref:`customization`). .. [2] As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, and similarly for tuples.
.. [1] Additional information on these special methods may be found in the Python Reference Manual (:ref:`customization`). .. [2] As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, and similarly for tuples.
python, official-docs, cpython, P0
Local_Trusted_Corpus
6d52184e-a72e-456e-b890-d9e07ba8ad9d
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,060
supabase-export-v2
90dc00d83f2903ca
object; ``import foo`` does not require a module object named *foo* to exist, rather it requires an (external) *definition* for a module named *foo* somewhere.) A special attribute of every module is :attr:`~object.__dict__`. This is the dictionary containing the module's symbol table. Modifying this dictionary will ac...
trusted_official_docs
CPython Docs
object; ``import foo`` does not require a module object named *foo* to exist, rather it requires an (external) *definition* for a module named *foo* somewhere.) A special attribute of every module is :attr:`~object.__dict__`. This is the dictionary containing the module's symbol table. Modifying this dictionary will ac...
object; ``import foo`` does not require a module object named *foo* to exist, rather it requires an (external) *definition* for a module named *foo* somewhere.) A special attribute of every module is :attr:`~object.__dict__`. This is the dictionary containing the module's symbol table. Modifying this dictionary will ac...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6d94f4f2-6157-4f5d-a1c2-edd3fc84b535
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,737
supabase-export-v2
fcc18c8de8fa34cb
Multi-dimensional arrays:: >>> import struct >>> buf = struct.pack("d"*12, *[1.5*x for x in range(12)]) >>> x = memoryview(buf) >>> y = x.cast('d', shape=[3,4]) >>> y.tolist() [[0.0, 1.5, 3.0, 4.5], [6.0, 7.5, 9.0, 10.5], [12.0, 13.5, 15.0, 16.5]] >>> len(y) 3 >>> y.nbytes 96
trusted_official_docs
CPython Docs
Multi-dimensional arrays:: >>> import struct >>> buf = struct.pack("d"*12, *[1.5*x for x in range(12)]) >>> x = memoryview(buf) >>> y = x.cast('d', shape=[3,4]) >>> y.tolist() [[0.0, 1.5, 3.0, 4.5], [6.0, 7.5, 9.0, 10.5], [12.0, 13.5, 15.0, 16.5]] >>> len(y) 3 >>> y.nbytes 96
Multi-dimensional arrays:: >>> import struct >>> buf = struct.pack("d"*12, *[1.5*x for x in range(12)]) >>> x = memoryview(buf) >>> y = x.cast('d', shape=[3,4]) >>> y.tolist() [[0.0, 1.5, 3.0, 4.5], [6.0, 7.5, 9.0, 10.5], [12.0, 13.5, 15.0, 16.5]] >>> len(y) 3 >>> y.nbytes 96
python, official-docs, cpython, P0
Local_Trusted_Corpus
6e21562b-4131-49da-a5a1-049425de3b7c
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,735
supabase-export-v2
cc36dfa0dcc2d815
len(m.tobytes())``. This is the amount of space in bytes that the array would use in a contiguous representation. It is not necessarily equal to ``len(m)``:: >>> import array >>> a = array.array('i', [1,2,3,4,5]) >>> m = memoryview(a) >>> len(m) 5 >>> m.nbytes 20 >>> y = m[::2] >>> len(y) 3 >>> y.nbytes 12 ...
trusted_official_docs
CPython Docs
len(m.tobytes())``. This is the amount of space in bytes that the array would use in a contiguous representation. It is not necessarily equal to ``len(m)``:: >>> import array >>> a = array.array('i', [1,2,3,4,5]) >>> m = memoryview(a) >>> len(m) 5 >>> m.nbytes 20 >>> y = m[::2] >>> len(y) 3 >>> y.nbytes 12 ...
len(m.tobytes())``. This is the amount of space in bytes that the array would use in a contiguous representation. It is not necessarily equal to ``len(m)``:: >>> import array >>> a = array.array('i', [1,2,3,4,5]) >>> m = memoryview(a) >>> len(m) 5 >>> m.nbytes 20 >>> y = m[::2] >>> len(y) 3 >>> y.nbytes 12 ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
70096b04-239f-403b-8f02-730157f0b010
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,804
supabase-export-v2
9c20b8fb024494c6
their operator based counterparts require their arguments to be sets. This precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of the more readable ``set('abc').intersection('cbs')``. Both :class:`set` and :class:`frozenset` support set to set comparisons. Two sets are equal if and only if every el...
trusted_official_docs
CPython Docs
their operator based counterparts require their arguments to be sets. This precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of the more readable ``set('abc').intersection('cbs')``. Both :class:`set` and :class:`frozenset` support set to set comparisons. Two sets are equal if and only if every el...
their operator based counterparts require their arguments to be sets. This precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of the more readable ``set('abc').intersection('cbs')``. Both :class:`set` and :class:`frozenset` support set to set comparisons. Two sets are equal if and only if every el...
python, official-docs, cpython, P0
Local_Trusted_Corpus
71d30a97-5f40-4697-8256-e93c51d81d26
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,849
supabase-export-v2
f0647a2ba7e2d858
{'one': 42, 'two': 2, 'three': 3, 'four': 4} >>> del d["two"] >>> d["two"] = None >>> d {'one': 42, 'three': 3, 'four': 4, 'two': None} .. versionchanged:: 3.7 Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6.
trusted_official_docs
CPython Docs
{'one': 42, 'two': 2, 'three': 3, 'four': 4} >>> del d["two"] >>> d["two"] = None >>> d {'one': 42, 'three': 3, 'four': 4, 'two': None} .. versionchanged:: 3.7 Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6.
{'one': 42, 'two': 2, 'three': 3, 'four': 4} >>> del d["two"] >>> d["two"] = None >>> d {'one': 42, 'three': 3, 'four': 4, 'two': None} .. versionchanged:: 3.7 Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6.
python, official-docs, cpython, P0
Local_Trusted_Corpus
737609e5-92f3-4627-aa60-da5ac10af28d
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,981
supabase-export-v2
672da6f25a7e43bc
.. describe:: T[X, Y, ...] Creates a ``GenericAlias`` representing a type ``T`` parameterized by types *X*, *Y*, and more depending on the ``T`` used. For example, a function expecting a :class:`list` containing :class:`float` elements::
trusted_official_docs
CPython Docs
.. describe:: T[X, Y, ...] Creates a ``GenericAlias`` representing a type ``T`` parameterized by types *X*, *Y*, and more depending on the ``T`` used. For example, a function expecting a :class:`list` containing :class:`float` elements::
.. describe:: T[X, Y, ...] Creates a ``GenericAlias`` representing a type ``T`` parameterized by types *X*, *Y*, and more depending on the ``T`` used. For example, a function expecting a :class:`list` containing :class:`float` elements::
python, official-docs, cpython, P0
Local_Trusted_Corpus
751ba382-c2c7-41fc-b2df-dfb69ae7b8e2
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,903
supabase-export-v2
998619d7b8b2eca0
.. describe:: d | other Create a new dictionary with the merged keys and values of *d* and *other*, which must both be dictionaries. The values of *other* take priority when *d* and *other* share keys.
trusted_official_docs
CPython Docs
.. describe:: d | other Create a new dictionary with the merged keys and values of *d* and *other*, which must both be dictionaries. The values of *other* take priority when *d* and *other* share keys.
.. describe:: d | other Create a new dictionary with the merged keys and values of *d* and *other*, which must both be dictionaries. The values of *other* take priority when *d* and *other* share keys.
python, official-docs, cpython, P0
Local_Trusted_Corpus
76739418-5c28-4868-aa76-35fe41e002c6
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,163
supabase-export-v2
5f79e702603bc324
.. [4] Cased characters are those with general category property being one of "Lu" (Letter, uppercase), "Ll" (Letter, lowercase), or "Lt" (Letter, titlecase). .. [5] To format only a tuple you should therefore provide a singleton tuple whose only element is the tuple to be formatted.
trusted_official_docs
CPython Docs
.. [4] Cased characters are those with general category property being one of "Lu" (Letter, uppercase), "Ll" (Letter, lowercase), or "Lt" (Letter, titlecase). .. [5] To format only a tuple you should therefore provide a singleton tuple whose only element is the tuple to be formatted.
.. [4] Cased characters are those with general category property being one of "Lu" (Letter, uppercase), "Ll" (Letter, lowercase), or "Lt" (Letter, titlecase). .. [5] To format only a tuple you should therefore provide a singleton tuple whose only element is the tuple to be formatted.
python, official-docs, cpython, P0
Local_Trusted_Corpus
77f40182-ac39-4e4c-b107-d4ea83205745
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,971
supabase-export-v2
331b133ee302e700
.. index:: pair: object; GenericAlias pair: Generic; Alias ``GenericAlias`` objects are generally created by :ref:`subscripting <subscriptions>` a class. They are most often used with :ref:`container classes <sequence-types>`, such as :class:`list` or :class:`dict`. For example, ``list[int]`` is a ``GenericAlias`` obje...
trusted_official_docs
CPython Docs
.. index:: pair: object; GenericAlias pair: Generic; Alias ``GenericAlias`` objects are generally created by :ref:`subscripting <subscriptions>` a class. They are most often used with :ref:`container classes <sequence-types>`, such as :class:`list` or :class:`dict`. For example, ``list[int]`` is a ``GenericAlias`` obje...
.. index:: pair: object; GenericAlias pair: Generic; Alias ``GenericAlias`` objects are generally created by :ref:`subscripting <subscriptions>` a class. They are most often used with :ref:`container classes <sequence-types>`, such as :class:`list` or :class:`dict`. For example, ``list[int]`` is a ``GenericAlias`` obje...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7945ad57-98fb-496e-b724-f55cf91708ad
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,741
supabase-export-v2
c6c8f974e68f5dd2
.. attribute:: format A string containing the format (in :mod:`struct` module style) for each element in the view. A memoryview can be created from exporters with arbitrary format strings, but some methods (e.g. :meth:`tolist`) are restricted to native single element formats.
trusted_official_docs
CPython Docs
.. attribute:: format A string containing the format (in :mod:`struct` module style) for each element in the view. A memoryview can be created from exporters with arbitrary format strings, but some methods (e.g. :meth:`tolist`) are restricted to native single element formats.
.. attribute:: format A string containing the format (in :mod:`struct` module style) for each element in the view. A memoryview can be created from exporters with arbitrary format strings, but some methods (e.g. :meth:`tolist`) are restricted to native single element formats.
python, official-docs, cpython, P0
Local_Trusted_Corpus
79568fab-3a3f-4be8-ab25-f41dddcf7f36
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,996
supabase-export-v2
3612f710ec8e4e05
The :meth:`~object.__getitem__` method of generic containers will raise an exception to disallow mistakes like ``dict[str][str]``:: >>> dict[str][str] Traceback (most recent call last): ... TypeError: dict[str] is not a generic class
trusted_official_docs
CPython Docs
The :meth:`~object.__getitem__` method of generic containers will raise an exception to disallow mistakes like ``dict[str][str]``:: >>> dict[str][str] Traceback (most recent call last): ... TypeError: dict[str] is not a generic class
The :meth:`~object.__getitem__` method of generic containers will raise an exception to disallow mistakes like ``dict[str][str]``:: >>> dict[str][str] Traceback (most recent call last): ... TypeError: dict[str] is not a generic class
python, official-docs, cpython, P0
Local_Trusted_Corpus
797e8f9b-912e-48d1-b9da-26f7b9d9e1ec
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,067
supabase-export-v2
c090d3107ae79c2b
Function objects are created by function definitions. The only operation on a function object is to call it: ``func(argument-list)``. There are really two flavors of function objects: built-in functions and user-defined functions. Both support the same operation (to call the function), but the implementation is differe...
trusted_official_docs
CPython Docs
Function objects are created by function definitions. The only operation on a function object is to call it: ``func(argument-list)``. There are really two flavors of function objects: built-in functions and user-defined functions. Both support the same operation (to call the function), but the implementation is differe...
Function objects are created by function definitions. The only operation on a function object is to call it: ``func(argument-list)``. There are really two flavors of function objects: built-in functions and user-defined functions. Both support the same operation (to call the function), but the implementation is differe...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7cbad917-cd93-4580-b364-6c94f8685cc1
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,103
supabase-export-v2
624c97a934a5056b
- The default Python prompt of the :term:`interactive` shell when partial input is incomplete. Lastly, the Python documentation often uses three dots in conventional English usage to mean omitted content, even in code examples that also use them as the ``Ellipsis``.
trusted_official_docs
CPython Docs
- The default Python prompt of the :term:`interactive` shell when partial input is incomplete. Lastly, the Python documentation often uses three dots in conventional English usage to mean omitted content, even in code examples that also use them as the ``Ellipsis``.
- The default Python prompt of the :term:`interactive` shell when partial input is incomplete. Lastly, the Python documentation often uses three dots in conventional English usage to mean omitted content, even in code examples that also use them as the ``Ellipsis``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7fdf42e8-b1e7-4e7f-b168-f13173540b8d
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
24,048
supabase-export-v2
c2a4c1afdf11e327
typing >>> isinstance(int | str, typing.Union) True >>> typing.Union() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot create 'typing.Union' instances .. note:: The :meth:`!__or__` method for type objects was added to support the syntax ``X | Y``. If a metaclass implements :me...
trusted_official_docs
CPython Docs
typing >>> isinstance(int | str, typing.Union) True >>> typing.Union() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot create 'typing.Union' instances .. note:: The :meth:`!__or__` method for type objects was added to support the syntax ``X | Y``. If a metaclass implements :me...
typing >>> isinstance(int | str, typing.Union) True >>> typing.Union() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot create 'typing.Union' instances .. note:: The :meth:`!__or__` method for type objects was added to support the syntax ``X | Y``. If a metaclass implements :me...
python, official-docs, cpython, P0
Local_Trusted_Corpus
80eaa92f-31a0-4d2f-8031-d74247a7e60f
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,770
supabase-export-v2
c80ecc2227adaae9
its contents cannot be altered after it is created; it can therefore be used as a dictionary key or as an element of another set. Non-empty sets (not frozensets) can be created by placing a comma-separated list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in addition to the :class:`set` constructor.
trusted_official_docs
CPython Docs
its contents cannot be altered after it is created; it can therefore be used as a dictionary key or as an element of another set. Non-empty sets (not frozensets) can be created by placing a comma-separated list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in addition to the :class:`set` constructor.
its contents cannot be altered after it is created; it can therefore be used as a dictionary key or as an element of another set. Non-empty sets (not frozensets) can be created by placing a comma-separated list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in addition to the :class:`set` constructor.
python, official-docs, cpython, P0
Local_Trusted_Corpus
81c44157-3d71-46bb-8138-bd8d445d86d1
CPython Docs
file://datasets/cpython/Doc/library/stdtypes.rst
unknown
a3cf8bc4-60ee-4147-adb3-d0deb77581ec
23,785
supabase-export-v2
f7ac47c224564c02
Return ``True`` if the set has no elements in common with *other*. Sets are disjoint if and only if their intersection is the empty set. .. method:: frozenset.issubset(other, /) set.issubset(other, /) .. describe:: set <= other
trusted_official_docs
CPython Docs
Return ``True`` if the set has no elements in common with *other*. Sets are disjoint if and only if their intersection is the empty set. .. method:: frozenset.issubset(other, /) set.issubset(other, /) .. describe:: set <= other
Return ``True`` if the set has no elements in common with *other*. Sets are disjoint if and only if their intersection is the empty set. .. method:: frozenset.issubset(other, /) set.issubset(other, /) .. describe:: set <= other
python, official-docs, cpython, P0
Local_Trusted_Corpus