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
1b608ed9-4294-4129-b5e9-3e5b01fc752b
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,675
supabase-export-v2
9135feedca439751
.. data:: LazyImportType The type of lazy import proxy objects. These objects are created when a module is lazily imported and serve as placeholders until the module is actually accessed. This type can be used to detect lazy imports programmatically.
trusted_official_docs
CPython Docs
.. data:: LazyImportType The type of lazy import proxy objects. These objects are created when a module is lazily imported and serve as placeholders until the module is actually accessed. This type can be used to detect lazy imports programmatically.
.. data:: LazyImportType The type of lazy import proxy objects. These objects are created when a module is lazily imported and serve as placeholders until the module is actually accessed. This type can be used to detect lazy imports programmatically.
python, official-docs, cpython, P0
Local_Trusted_Corpus
267fac24-f67b-4d0a-802c-699fbec14014
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,604
supabase-export-v2
1d61319ae46a44c8
required to implement a Python interpreter. It deliberately avoids including some of the types that arise only incidentally during processing such as the ``listiterator`` type. Typical use of these names is for :func:`isinstance` or :func:`issubclass` checks.
trusted_official_docs
CPython Docs
required to implement a Python interpreter. It deliberately avoids including some of the types that arise only incidentally during processing such as the ``listiterator`` type. Typical use of these names is for :func:`isinstance` or :func:`issubclass` checks.
required to implement a Python interpreter. It deliberately avoids including some of the types that arise only incidentally during processing such as the ``listiterator`` type. Typical use of these names is for :func:`isinstance` or :func:`issubclass` checks.
python, official-docs, cpython, P0
Local_Trusted_Corpus
2973471e-559d-44e0-8753-f5244888bd3e
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,678
supabase-export-v2
9087387b55702370
.. data:: GetSetDescriptorType The type of objects defined in extension modules with ``PyGetSetDef``, such as :attr:`FrameType.f_locals <frame.f_locals>` or ``array.array.typecode``. This type is used as descriptor for object attributes; it has the same purpose as the :class:`property` type, but for classes defined ...
trusted_official_docs
CPython Docs
.. data:: GetSetDescriptorType The type of objects defined in extension modules with ``PyGetSetDef``, such as :attr:`FrameType.f_locals <frame.f_locals>` or ``array.array.typecode``. This type is used as descriptor for object attributes; it has the same purpose as the :class:`property` type, but for classes defined ...
.. data:: GetSetDescriptorType The type of objects defined in extension modules with ``PyGetSetDef``, such as :attr:`FrameType.f_locals <frame.f_locals>` or ``array.array.typecode``. This type is used as descriptor for object attributes; it has the same purpose as the :class:`property` type, but for classes defined ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3125720f-2cde-4ef2-89af-b1acb6ec05fb
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,624
supabase-export-v2
ce9971f92a35dcd5
.. audit-event:: code.__new__ code,filename,name,argcount,posonlyargcount,kwonlyargcount,nlocals,stacksize,flags types.CodeType Note that the audited arguments may not match the names or positions required by the initializer. The audit event only occurs for direct instantiation of code objects, and is not raised for ...
trusted_official_docs
CPython Docs
.. audit-event:: code.__new__ code,filename,name,argcount,posonlyargcount,kwonlyargcount,nlocals,stacksize,flags types.CodeType Note that the audited arguments may not match the names or positions required by the initializer. The audit event only occurs for direct instantiation of code objects, and is not raised for ...
.. audit-event:: code.__new__ code,filename,name,argcount,posonlyargcount,kwonlyargcount,nlocals,stacksize,flags types.CodeType Note that the audited arguments may not match the names or positions required by the initializer. The audit event only occurs for direct instantiation of code objects, and is not raised for ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
346307bb-da0f-461d-ad34-0d5655fd7301
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,572
supabase-export-v2
b61bfef87fc016df
Creates a class object dynamically using the appropriate metaclass. The first three arguments are the components that make up a class definition header: the class name, the base classes (in order), the keyword arguments (such as ``metaclass``).
trusted_official_docs
CPython Docs
Creates a class object dynamically using the appropriate metaclass. The first three arguments are the components that make up a class definition header: the class name, the base classes (in order), the keyword arguments (such as ``metaclass``).
Creates a class object dynamically using the appropriate metaclass. The first three arguments are the components that make up a class definition header: the class name, the base classes (in order), the keyword arguments (such as ``metaclass``).
python, official-docs, cpython, P0
Local_Trusted_Corpus
3b72ae58-da57-4721-936b-7f9a7f67e9bb
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,681
supabase-export-v2
f902f223c3f51428
simple C data members which use standard conversion functions; it has the same purpose as the :class:`property` type, but for classes defined in extension modules. In addition, when a class is defined with a :attr:`~object.__slots__` attribute, then for each slot, an instance of :class:`!MemberDescriptorType` will be ...
trusted_official_docs
CPython Docs
simple C data members which use standard conversion functions; it has the same purpose as the :class:`property` type, but for classes defined in extension modules. In addition, when a class is defined with a :attr:`~object.__slots__` attribute, then for each slot, an instance of :class:`!MemberDescriptorType` will be ...
simple C data members which use standard conversion functions; it has the same purpose as the :class:`property` type, but for classes defined in extension modules. In addition, when a class is defined with a :attr:`~object.__slots__` attribute, then for each slot, an instance of :class:`!MemberDescriptorType` will be ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
48f780b6-e1d0-4216-9377-ab83821dab26
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,591
supabase-export-v2
c364ad05d5ae696a
*cls* before the :meth:`~object.__mro_entries__` method has been called on any bases (following the mechanisms laid out in :pep:`560`). This is useful for introspecting :ref:`Generics <user-defined-generics>`. For classes that have an ``__orig_bases__`` attribute, this function returns the value of ``cls.__orig_bases_...
trusted_official_docs
CPython Docs
*cls* before the :meth:`~object.__mro_entries__` method has been called on any bases (following the mechanisms laid out in :pep:`560`). This is useful for introspecting :ref:`Generics <user-defined-generics>`. For classes that have an ``__orig_bases__`` attribute, this function returns the value of ``cls.__orig_bases_...
*cls* before the :meth:`~object.__mro_entries__` method has been called on any bases (following the mechanisms laid out in :pep:`560`). This is useful for introspecting :ref:`Generics <user-defined-generics>`. For classes that have an ``__orig_bases__`` attribute, this function returns the value of ``cls.__orig_bases_...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4a7236dd-dcea-49ff-809d-ee3821540c2b
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,578
supabase-export-v2
350c85fa359a74d1
are the components that make up a class definition header: the class name, the base classes (in order) and the keyword arguments (such as ``metaclass``). The return value is a 3-tuple: ``metaclass, namespace, kwds``
trusted_official_docs
CPython Docs
are the components that make up a class definition header: the class name, the base classes (in order) and the keyword arguments (such as ``metaclass``). The return value is a 3-tuple: ``metaclass, namespace, kwds``
are the components that make up a class definition header: the class name, the base classes (in order) and the keyword arguments (such as ``metaclass``). The return value is a 3-tuple: ``metaclass, namespace, kwds``
python, official-docs, cpython, P0
Local_Trusted_Corpus
5476bbc1-06fc-4795-95af-be1ea30bbed8
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,722
supabase-export-v2
c526459755a12aac
def __eq__(self, other): if isinstance(self, SimpleNamespace) and isinstance(other, SimpleNamespace): return self.__dict__ == other.__dict__ return NotImplemented ``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. However, for a structured record type use :func:`~collections.namedtuple` instead...
trusted_official_docs
CPython Docs
def __eq__(self, other): if isinstance(self, SimpleNamespace) and isinstance(other, SimpleNamespace): return self.__dict__ == other.__dict__ return NotImplemented ``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. However, for a structured record type use :func:`~collections.namedtuple` instead...
def __eq__(self, other): if isinstance(self, SimpleNamespace) and isinstance(other, SimpleNamespace): return self.__dict__ == other.__dict__ return NotImplemented ``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. However, for a structured record type use :func:`~collections.namedtuple` instead...
python, official-docs, cpython, P0
Local_Trusted_Corpus
61ca4209-babb-4d7d-8781-8ded6e604478
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,577
supabase-export-v2
b1cfedf00c083484
Calculates the appropriate metaclass and creates the class namespace. The arguments are the components that make up a class definition header: the class name, the base classes (in order) and the keyword arguments (such as ``metaclass``).
trusted_official_docs
CPython Docs
Calculates the appropriate metaclass and creates the class namespace. The arguments are the components that make up a class definition header: the class name, the base classes (in order) and the keyword arguments (such as ``metaclass``).
Calculates the appropriate metaclass and creates the class namespace. The arguments are the components that make up a class definition header: the class name, the base classes (in order) and the keyword arguments (such as ``metaclass``).
python, official-docs, cpython, P0
Local_Trusted_Corpus
66efb2dc-a719-448c-b4f9-2ed1ca697f17
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,579
supabase-export-v2
c78c56cc5375f396
The return value is a 3-tuple: ``metaclass, namespace, kwds`` *metaclass* is the appropriate metaclass, *namespace* is the prepared class namespace and *kwds* is an updated copy of the passed in *kwds* argument with any ``'metaclass'`` entry removed. If no *kwds* argument is passed in, this will be an empty dict.
trusted_official_docs
CPython Docs
The return value is a 3-tuple: ``metaclass, namespace, kwds`` *metaclass* is the appropriate metaclass, *namespace* is the prepared class namespace and *kwds* is an updated copy of the passed in *kwds* argument with any ``'metaclass'`` entry removed. If no *kwds* argument is passed in, this will be an empty dict.
The return value is a 3-tuple: ``metaclass, namespace, kwds`` *metaclass* is the appropriate metaclass, *namespace* is the prepared class namespace and *kwds* is an updated copy of the passed in *kwds* argument with any ``'metaclass'`` entry removed. If no *kwds* argument is passed in, this will be an empty dict.
python, official-docs, cpython, P0
Local_Trusted_Corpus
67acb5db-1686-4507-a62c-02180568e17d
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,567
supabase-export-v2
c451f6b503dd3e71
This module defines utility functions to assist in dynamic creation of new types. It also defines names for some object types that are used by the standard Python interpreter, but not exposed as builtins like :class:`int` or :class:`str` are.
trusted_official_docs
CPython Docs
This module defines utility functions to assist in dynamic creation of new types. It also defines names for some object types that are used by the standard Python interpreter, but not exposed as builtins like :class:`int` or :class:`str` are.
This module defines utility functions to assist in dynamic creation of new types. It also defines names for some object types that are used by the standard Python interpreter, but not exposed as builtins like :class:`int` or :class:`str` are.
python, official-docs, cpython, P0
Local_Trusted_Corpus
6be11bed-8d85-4faf-a19e-6d379fea350c
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,730
supabase-export-v2
7523b8641a6bafc8
access remains normal, but access to an attribute through a class will be routed to the class's __getattr__ method; this is done by raising AttributeError. This allows one to have properties active on an instance, and have virtual attributes on the class with the same name (see :class:`enum.Enum` for an example).
trusted_official_docs
CPython Docs
access remains normal, but access to an attribute through a class will be routed to the class's __getattr__ method; this is done by raising AttributeError. This allows one to have properties active on an instance, and have virtual attributes on the class with the same name (see :class:`enum.Enum` for an example).
access remains normal, but access to an attribute through a class will be routed to the class's __getattr__ method; this is done by raising AttributeError. This allows one to have properties active on an instance, and have virtual attributes on the class with the same name (see :class:`enum.Enum` for an example).
python, official-docs, cpython, P0
Local_Trusted_Corpus
7030b7a0-eaf9-457c-9206-8cc6d99cfe09
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,734
supabase-export-v2
94676f02b4de7e69
.. function:: coroutine(gen_func) This function transforms a :term:`generator` function into a :term:`coroutine function` which returns a generator-based coroutine. The generator-based coroutine is still a :term:`generator iterator`, but is also considered to be a :term:`coroutine` object and is :term:`awaitable`. H...
trusted_official_docs
CPython Docs
.. function:: coroutine(gen_func) This function transforms a :term:`generator` function into a :term:`coroutine function` which returns a generator-based coroutine. The generator-based coroutine is still a :term:`generator iterator`, but is also considered to be a :term:`coroutine` object and is :term:`awaitable`. H...
.. function:: coroutine(gen_func) This function transforms a :term:`generator` function into a :term:`coroutine function` which returns a generator-based coroutine. The generator-based coroutine is still a :term:`generator iterator`, but is also considered to be a :term:`coroutine` object and is :term:`awaitable`. H...
python, official-docs, cpython, P0
Local_Trusted_Corpus
778fd611-3f97-40dd-a232-6ba6613430ef
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,603
supabase-export-v2
dc495ab08d0ac0ff
Standard Interpreter Types -------------------------- This module provides names for many of the types that are required to implement a Python interpreter. It deliberately avoids including some of the types that arise only incidentally during processing such as the ``listiterator`` type.
trusted_official_docs
CPython Docs
Standard Interpreter Types -------------------------- This module provides names for many of the types that are required to implement a Python interpreter. It deliberately avoids including some of the types that arise only incidentally during processing such as the ``listiterator`` type.
Standard Interpreter Types -------------------------- This module provides names for many of the types that are required to implement a Python interpreter. It deliberately avoids including some of the types that arise only incidentally during processing such as the ``listiterator`` type.
python, official-docs, cpython, P0
Local_Trusted_Corpus
792d6daf-4cfa-4ab0-b164-010bfc8390e5
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,581
supabase-export-v2
327f59b3ed6546a3
.. versionchanged:: 3.6 The default value for the ``namespace`` element of the returned tuple has changed. Now an insertion-order-preserving mapping is used when the metaclass does not have a ``__prepare__`` method.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.6 The default value for the ``namespace`` element of the returned tuple has changed. Now an insertion-order-preserving mapping is used when the metaclass does not have a ``__prepare__`` method.
.. versionchanged:: 3.6 The default value for the ``namespace`` element of the returned tuple has changed. Now an insertion-order-preserving mapping is used when the metaclass does not have a ``__prepare__`` method.
python, official-docs, cpython, P0
Local_Trusted_Corpus
87487527-37c0-4e5c-8f85-e4d3731bbd86
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,590
supabase-export-v2
04a0ed63bc9caa8a
.. function:: get_original_bases(cls, /) Return the tuple of objects originally given as the bases of *cls* before the :meth:`~object.__mro_entries__` method has been called on any bases (following the mechanisms laid out in :pep:`560`). This is useful for introspecting :ref:`Generics <user-defined-generics>`.
trusted_official_docs
CPython Docs
.. function:: get_original_bases(cls, /) Return the tuple of objects originally given as the bases of *cls* before the :meth:`~object.__mro_entries__` method has been called on any bases (following the mechanisms laid out in :pep:`560`). This is useful for introspecting :ref:`Generics <user-defined-generics>`.
.. function:: get_original_bases(cls, /) Return the tuple of objects originally given as the bases of *cls* before the :meth:`~object.__mro_entries__` method has been called on any bases (following the mechanisms laid out in :pep:`560`). This is useful for introspecting :ref:`Generics <user-defined-generics>`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8f7ba0b8-2883-4452-a7ea-16a961aa88a5
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,718
supabase-export-v2
bdee2c948732e492
be updated with key-value pairs from that argument (either a mapping object or an :term:`iterable` object producing key-value pairs). All such keys must be strings. The type is roughly equivalent to the following code::
trusted_official_docs
CPython Docs
be updated with key-value pairs from that argument (either a mapping object or an :term:`iterable` object producing key-value pairs). All such keys must be strings. The type is roughly equivalent to the following code::
be updated with key-value pairs from that argument (either a mapping object or an :term:`iterable` object producing key-value pairs). All such keys must be strings. The type is roughly equivalent to the following code::
python, official-docs, cpython, P0
Local_Trusted_Corpus
9abacce6-f4b7-4124-9a50-756d90b013f0
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,594
supabase-export-v2
1f42d5add309b203
from typing import TypeVar, Generic, NamedTuple, TypedDict T = TypeVar("T") class Foo(Generic[T]): ... class Bar(Foo[int], float): ... class Baz(list[str]): ... Eggs = NamedTuple("Eggs", [("a", int), ("b", str)]) Spam = TypedDict("Spam", {"a": int, "b": str})
trusted_official_docs
CPython Docs
from typing import TypeVar, Generic, NamedTuple, TypedDict T = TypeVar("T") class Foo(Generic[T]): ... class Bar(Foo[int], float): ... class Baz(list[str]): ... Eggs = NamedTuple("Eggs", [("a", int), ("b", str)]) Spam = TypedDict("Spam", {"a": int, "b": str})
from typing import TypeVar, Generic, NamedTuple, TypedDict T = TypeVar("T") class Foo(Generic[T]): ... class Bar(Foo[int], float): ... class Baz(list[str]): ... Eggs = NamedTuple("Eggs", [("a", int), ("b", str)]) Spam = TypedDict("Spam", {"a": int, "b": str})
python, official-docs, cpython, P0
Local_Trusted_Corpus
9db9e558-f814-4d0f-a41f-8d6b30c96076
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,699
supabase-export-v2
9ae7df99abf68195
.. method:: get(key[, default]) Return the value for *key* if *key* is in the underlying mapping, 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]) Return the value for *key* if *key* is in the underlying mapping, else *default*. If *default* is not given, it defaults to ``None``, so that this method never raises a :exc:`KeyError`.
.. method:: get(key[, default]) Return the value for *key* if *key* is in the underlying mapping, 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
b569041e-4558-4977-89d7-9dc30ea09bb5
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,568
supabase-export-v2
8a9d6946ff7a0d9b
also defines names for some object types that are used by the standard Python interpreter, but not exposed as builtins like :class:`int` or :class:`str` are. Finally, it provides some additional type-related utility classes and functions that are not fundamental enough to be builtins.
trusted_official_docs
CPython Docs
also defines names for some object types that are used by the standard Python interpreter, but not exposed as builtins like :class:`int` or :class:`str` are. Finally, it provides some additional type-related utility classes and functions that are not fundamental enough to be builtins.
also defines names for some object types that are used by the standard Python interpreter, but not exposed as builtins like :class:`int` or :class:`str` are. Finally, it provides some additional type-related utility classes and functions that are not fundamental enough to be builtins.
python, official-docs, cpython, P0
Local_Trusted_Corpus
b5a2f95f-dc6d-4f75-b218-0d23d44a3c2f
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,649
supabase-export-v2
2f952c2552dab0c1
:ref:`Documentation on module objects <module-objects>` Provides details on the special attributes that can be found on instances of :class:`!ModuleType`. :func:`importlib.util.module_from_spec` Modules created using the :class:`!ModuleType` constructor are created with many of their special attributes unset or set t...
trusted_official_docs
CPython Docs
:ref:`Documentation on module objects <module-objects>` Provides details on the special attributes that can be found on instances of :class:`!ModuleType`. :func:`importlib.util.module_from_spec` Modules created using the :class:`!ModuleType` constructor are created with many of their special attributes unset or set t...
:ref:`Documentation on module objects <module-objects>` Provides details on the special attributes that can be found on instances of :class:`!ModuleType`. :func:`importlib.util.module_from_spec` Modules created using the :class:`!ModuleType` constructor are created with many of their special attributes unset or set t...
python, official-docs, cpython, P0
Local_Trusted_Corpus
d61209fb-6a61-4fa5-aa4c-5c5216e1b078
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,595
supabase-export-v2
4c5c0d4c5e9984ee
TypeVar("T") class Foo(Generic[T]): ... class Bar(Foo[int], float): ... class Baz(list[str]): ... Eggs = NamedTuple("Eggs", [("a", int), ("b", str)]) Spam = TypedDict("Spam", {"a": int, "b": str}) assert Bar.__bases__ == (Foo, float) assert get_original_bases(Bar) == (Foo[int], float)
trusted_official_docs
CPython Docs
TypeVar("T") class Foo(Generic[T]): ... class Bar(Foo[int], float): ... class Baz(list[str]): ... Eggs = NamedTuple("Eggs", [("a", int), ("b", str)]) Spam = TypedDict("Spam", {"a": int, "b": str}) assert Bar.__bases__ == (Foo, float) assert get_original_bases(Bar) == (Foo[int], float)
TypeVar("T") class Foo(Generic[T]): ... class Bar(Foo[int], float): ... class Baz(list[str]): ... Eggs = NamedTuple("Eggs", [("a", int), ("b", str)]) Spam = TypedDict("Spam", {"a": int, "b": str}) assert Bar.__bases__ == (Foo, float) assert get_original_bases(Bar) == (Foo[int], float)
python, official-docs, cpython, P0
Local_Trusted_Corpus
da7c8ae8-2091-4927-97cc-04da3f08fd9c
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,680
supabase-export-v2
e5e15b41f5cd4cf0
.. data:: MemberDescriptorType The type of objects defined in extension modules with ``PyMemberDef``, such as ``datetime.timedelta.days``. This type is used as descriptor for simple C data members which use standard conversion functions; it has the same purpose as the :class:`property` type, but for classes defined ...
trusted_official_docs
CPython Docs
.. data:: MemberDescriptorType The type of objects defined in extension modules with ``PyMemberDef``, such as ``datetime.timedelta.days``. This type is used as descriptor for simple C data members which use standard conversion functions; it has the same purpose as the :class:`property` type, but for classes defined ...
.. data:: MemberDescriptorType The type of objects defined in extension modules with ``PyMemberDef``, such as ``datetime.timedelta.days``. This type is used as descriptor for simple C data members which use standard conversion functions; it has the same purpose as the :class:`property` type, but for classes defined ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
e13d7d82-a631-4501-aeb6-84dd7cdea916
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,736
supabase-export-v2
51e3e0346c11cfd2
If *gen_func* is a generator function, it will be modified in-place. If *gen_func* is not a generator function, it will be wrapped. If it returns an instance of :class:`collections.abc.Generator`, the instance will be wrapped in an *awaitable* proxy object. All other types of objects will be returned as is.
trusted_official_docs
CPython Docs
If *gen_func* is a generator function, it will be modified in-place. If *gen_func* is not a generator function, it will be wrapped. If it returns an instance of :class:`collections.abc.Generator`, the instance will be wrapped in an *awaitable* proxy object. All other types of objects will be returned as is.
If *gen_func* is a generator function, it will be modified in-place. If *gen_func* is not a generator function, it will be wrapped. If it returns an instance of :class:`collections.abc.Generator`, the instance will be wrapped in an *awaitable* proxy object. All other types of objects will be returned as is.
python, official-docs, cpython, P0
Local_Trusted_Corpus
e20230f2-34da-4401-ad39-96df55286d0f
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,656
supabase-export-v2
ef1659b50e11419a
be a non-parameterized generic class, such as ``list``, ``tuple`` or ``dict``. ``t_args`` should be a :class:`tuple` (possibly of length 1) of types which parameterize ``t_origin``:: >>> from types import GenericAlias
trusted_official_docs
CPython Docs
be a non-parameterized generic class, such as ``list``, ``tuple`` or ``dict``. ``t_args`` should be a :class:`tuple` (possibly of length 1) of types which parameterize ``t_origin``:: >>> from types import GenericAlias
be a non-parameterized generic class, such as ``list``, ``tuple`` or ``dict``. ``t_args`` should be a :class:`tuple` (possibly of length 1) of types which parameterize ``t_origin``:: >>> from types import GenericAlias
python, official-docs, cpython, P0
Local_Trusted_Corpus
e67d30fa-e8df-45d7-a5b5-20854f73f8b6
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,735
supabase-export-v2
926dc7b26bbe53f5
still a :term:`generator iterator`, but is also considered to be a :term:`coroutine` object and is :term:`awaitable`. However, it may not necessarily implement the :meth:`~object.__await__` method. If *gen_func* is a generator function, it will be modified in-place.
trusted_official_docs
CPython Docs
still a :term:`generator iterator`, but is also considered to be a :term:`coroutine` object and is :term:`awaitable`. However, it may not necessarily implement the :meth:`~object.__await__` method. If *gen_func* is a generator function, it will be modified in-place.
still a :term:`generator iterator`, but is also considered to be a :term:`coroutine` object and is :term:`awaitable`. However, it may not necessarily implement the :meth:`~object.__await__` method. If *gen_func* is a generator function, it will be modified in-place.
python, official-docs, cpython, P0
Local_Trusted_Corpus
eca24863-e432-40b8-b49d-7d8985accd1e
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,729
supabase-export-v2
af09117a7834b42e
Route attribute access on a class to __getattr__. This is a descriptor, used to define attributes that act differently when accessed through an instance and through a class. Instance access remains normal, but access to an attribute through a class will be routed to the class's __getattr__ method; this is done by ra...
trusted_official_docs
CPython Docs
Route attribute access on a class to __getattr__. This is a descriptor, used to define attributes that act differently when accessed through an instance and through a class. Instance access remains normal, but access to an attribute through a class will be routed to the class's __getattr__ method; this is done by ra...
Route attribute access on a class to __getattr__. This is a descriptor, used to define attributes that act differently when accessed through an instance and through a class. Instance access remains normal, but access to an attribute through a class will be routed to the class's __getattr__ method; this is done by ra...
python, official-docs, cpython, P0
Local_Trusted_Corpus
f38467c6-b566-4592-8117-d1058282616a
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,717
supabase-export-v2
6bff7fad70f70814
Unlike :class:`object`, with :class:`!SimpleNamespace` you can add and remove attributes. :py:class:`SimpleNamespace` objects may be initialized in the same way as :class:`dict`: either with keyword arguments, with a single positional argument, or with both. When initialized with keyword arguments, those are directl...
trusted_official_docs
CPython Docs
Unlike :class:`object`, with :class:`!SimpleNamespace` you can add and remove attributes. :py:class:`SimpleNamespace` objects may be initialized in the same way as :class:`dict`: either with keyword arguments, with a single positional argument, or with both. When initialized with keyword arguments, those are directl...
Unlike :class:`object`, with :class:`!SimpleNamespace` you can add and remove attributes. :py:class:`SimpleNamespace` objects may be initialized in the same way as :class:`dict`: either with keyword arguments, with a single positional argument, or with both. When initialized with keyword arguments, those are directl...
python, official-docs, cpython, P0
Local_Trusted_Corpus
ff7c5f7c-4adf-4644-8939-c45bee0bc12f
CPython Docs
file://datasets/cpython/Doc/library/types.rst
unknown
3bcf4e41-59bb-42f7-90c9-1ec7bcbb0480
11,587
supabase-export-v2
0006e5d7c992b1d6
Resolve MRO entries dynamically as specified by :pep:`560`. This function looks for items in *bases* that are not instances of :class:`type`, and returns a tuple where each such object that has an :meth:`~object.__mro_entries__` method is replaced with an unpacked result of calling this method. If a *bases* item is ...
trusted_official_docs
CPython Docs
Resolve MRO entries dynamically as specified by :pep:`560`. This function looks for items in *bases* that are not instances of :class:`type`, and returns a tuple where each such object that has an :meth:`~object.__mro_entries__` method is replaced with an unpacked result of calling this method. If a *bases* item is ...
Resolve MRO entries dynamically as specified by :pep:`560`. This function looks for items in *bases* that are not instances of :class:`type`, and returns a tuple where each such object that has an :meth:`~object.__mro_entries__` method is replaced with an unpacked result of calling this method. If a *bases* item is ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
06708976-c646-4e60-ae0b-daba631d6894
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,743
supabase-export-v2
51d717314c4019da
a function to generate a byte-code file from a source file, and another function used when the module source file is invoked as a script. Though not often needed, this function can be useful when installing modules for shared use, especially if some of the users may not have permission to write the byte-code cache file...
trusted_official_docs
CPython Docs
a function to generate a byte-code file from a source file, and another function used when the module source file is invoked as a script. Though not often needed, this function can be useful when installing modules for shared use, especially if some of the users may not have permission to write the byte-code cache file...
a function to generate a byte-code file from a source file, and another function used when the module source file is invoked as a script. Though not often needed, this function can be useful when installing modules for shared use, especially if some of the users may not have permission to write the byte-code cache file...
python, official-docs, cpython, P0
Local_Trusted_Corpus
06fd08b8-1b1a-4f38-b9e3-01e2ecf50787
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,765
supabase-export-v2
7ca419296e1e4456
content. However, Python will at runtime assume the ``.pyc`` file is up to date and not validate the ``.pyc`` against the source file at all. This option is useful when the ``.pycs`` are kept up to date by some system external to Python like a build system.
trusted_official_docs
CPython Docs
content. However, Python will at runtime assume the ``.pyc`` file is up to date and not validate the ``.pyc`` against the source file at all. This option is useful when the ``.pycs`` are kept up to date by some system external to Python like a build system.
content. However, Python will at runtime assume the ``.pyc`` file is up to date and not validate the ``.pyc`` against the source file at all. This option is useful when the ``.pycs`` are kept up to date by some system external to Python like a build system.
python, official-docs, cpython, P0
Local_Trusted_Corpus
09010d2c-ec80-4b0c-9667-5cb80c544cba
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,751
supabase-export-v2
9c3ecf5a3b3c31da
*optimize* controls the optimization level and is passed to the built-in :func:`compile` function. The default of ``-1`` selects the optimization level of the current interpreter. *invalidation_mode* should be a member of the :class:`PycInvalidationMode` enum and controls how the generated bytecode cache is invalidate...
trusted_official_docs
CPython Docs
*optimize* controls the optimization level and is passed to the built-in :func:`compile` function. The default of ``-1`` selects the optimization level of the current interpreter. *invalidation_mode* should be a member of the :class:`PycInvalidationMode` enum and controls how the generated bytecode cache is invalidate...
*optimize* controls the optimization level and is passed to the built-in :func:`compile` function. The default of ``-1`` selects the optimization level of the current interpreter. *invalidation_mode* should be a member of the :class:`PycInvalidationMode` enum and controls how the generated bytecode cache is invalidate...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1cb9b482-286c-46d1-b256-ab9361386e64
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,749
supabase-export-v2
73fc38d09fc7926e
a path. If *doraise* is true, a :exc:`PyCompileError` is raised instead. However if *quiet* is 2, no message is written, and *doraise* has no effect. If the path that *cfile* becomes (either explicitly specified or computed) is a symlink or non-regular file, :exc:`FileExistsError` will be raised. This is to act as a w...
trusted_official_docs
CPython Docs
a path. If *doraise* is true, a :exc:`PyCompileError` is raised instead. However if *quiet* is 2, no message is written, and *doraise* has no effect. If the path that *cfile* becomes (either explicitly specified or computed) is a symlink or non-regular file, :exc:`FileExistsError` will be raised. This is to act as a w...
a path. If *doraise* is true, a :exc:`PyCompileError` is raised instead. However if *quiet* is 2, no message is written, and *doraise* has no effect. If the path that *cfile* becomes (either explicitly specified or computed) is a symlink or non-regular file, :exc:`FileExistsError` will be raised. This is to act as a w...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1fc867dc-ab66-4e67-8632-9f1920e9e234
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,748
supabase-export-v2
0ecf018a0cc1d2e7
error string is written to ``sys.stderr``, but no exception is raised. This function returns the path to byte-compiled file, i.e. whatever *cfile* value was used. The *doraise* and *quiet* arguments determine how errors are handled while compiling file. If *quiet* is 0 or 1, and *doraise* is false, the default behavi...
trusted_official_docs
CPython Docs
error string is written to ``sys.stderr``, but no exception is raised. This function returns the path to byte-compiled file, i.e. whatever *cfile* value was used. The *doraise* and *quiet* arguments determine how errors are handled while compiling file. If *quiet* is 0 or 1, and *doraise* is false, the default behavi...
error string is written to ``sys.stderr``, but no exception is raised. This function returns the path to byte-compiled file, i.e. whatever *cfile* value was used. The *doraise* and *quiet* arguments determine how errors are handled while compiling file. If *quiet* is 0 or 1, and *doraise* is false, the default behavi...
python, official-docs, cpython, P0
Local_Trusted_Corpus
352655eb-4901-4a3a-a88d-689372e0e8ce
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,756
supabase-export-v2
b2ac5b8a6d11d269
.. versionchanged:: 3.7.2 The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer overrides the value of the *invalidation_mode* argument, and determines its default value instead. .. versionchanged:: 3.8 The *quiet* parameter was added.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.7.2 The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer overrides the value of the *invalidation_mode* argument, and determines its default value instead. .. versionchanged:: 3.8 The *quiet* parameter was added.
.. versionchanged:: 3.7.2 The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer overrides the value of the *invalidation_mode* argument, and determines its default value instead. .. versionchanged:: 3.8 The *quiet* parameter was added.
python, official-docs, cpython, P0
Local_Trusted_Corpus
387411da-5eb4-47bd-a695-9594d3e9a225
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,755
supabase-export-v2
efe2b96649d5a9f5
.. versionchanged:: 3.7 The *invalidation_mode* parameter was added as specified in :pep:`552`. If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, *invalidation_mode* will be forced to :attr:`PycInvalidationMode.CHECKED_HASH`. .. versionchanged:: 3.7.2 The :envvar:`SOURCE_DATE_EPOCH` environment variable ...
trusted_official_docs
CPython Docs
.. versionchanged:: 3.7 The *invalidation_mode* parameter was added as specified in :pep:`552`. If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, *invalidation_mode* will be forced to :attr:`PycInvalidationMode.CHECKED_HASH`. .. versionchanged:: 3.7.2 The :envvar:`SOURCE_DATE_EPOCH` environment variable ...
.. versionchanged:: 3.7 The *invalidation_mode* parameter was added as specified in :pep:`552`. If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, *invalidation_mode* will be forced to :attr:`PycInvalidationMode.CHECKED_HASH`. .. versionchanged:: 3.7.2 The :envvar:`SOURCE_DATE_EPOCH` environment variable ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4484c2b6-05d7-459d-b7a8-80fff4e70480
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,769
supabase-export-v2
c37179f7122cffeb
structure to locate source files; it only compiles files named explicitly. The exit status is nonzero if one of the files could not be compiled. .. program:: python -m py_compile
trusted_official_docs
CPython Docs
structure to locate source files; it only compiles files named explicitly. The exit status is nonzero if one of the files could not be compiled. .. program:: python -m py_compile
structure to locate source files; it only compiles files named explicitly. The exit status is nonzero if one of the files could not be compiled. .. program:: python -m py_compile
python, official-docs, cpython, P0
Local_Trusted_Corpus
5ac691c3-fbc3-4d9e-a507-4a922f7a2563
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,762
supabase-export-v2
b7ce8d3e9fd632a4
.. attribute:: CHECKED_HASH The ``.pyc`` file includes a hash of the source file content, which Python will compare against the source at runtime to determine if the ``.pyc`` file needs to be regenerated.
trusted_official_docs
CPython Docs
.. attribute:: CHECKED_HASH The ``.pyc`` file includes a hash of the source file content, which Python will compare against the source at runtime to determine if the ``.pyc`` file needs to be regenerated.
.. attribute:: CHECKED_HASH The ``.pyc`` file includes a hash of the source file content, which Python will compare against the source at runtime to determine if the ``.pyc`` file needs to be regenerated.
python, official-docs, cpython, P0
Local_Trusted_Corpus
6713186d-c8c1-4d34-860b-b47716ffc818
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,768
supabase-export-v2
04b38434b09e069d
Command-Line Interface ---------------------- This module can be invoked as a script to compile several source files. The files named in *filenames* are compiled and the resulting bytecode is cached in the normal manner. This program does not search a directory structure to locate source files; it only compiles files n...
trusted_official_docs
CPython Docs
Command-Line Interface ---------------------- This module can be invoked as a script to compile several source files. The files named in *filenames* are compiled and the resulting bytecode is cached in the normal manner. This program does not search a directory structure to locate source files; it only compiles files n...
Command-Line Interface ---------------------- This module can be invoked as a script to compile several source files. The files named in *filenames* are compiled and the resulting bytecode is cached in the normal manner. This program does not search a directory structure to locate source files; it only compiles files n...
python, official-docs, cpython, P0
Local_Trusted_Corpus
69176ada-56bd-430a-94e5-d451d50a946c
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,753
supabase-export-v2
1ec3cd4d2f7f8a3e
3.2 Changed default value of *cfile* to be :PEP:`3147`-compliant. Previous default was *file* + ``'c'`` (``'o'`` if optimization was enabled). Also added the *optimize* parameter. .. versionchanged:: 3.4 Changed code to use :mod:`importlib` for the byte-code cache file writing. This means file creation/writing semanti...
trusted_official_docs
CPython Docs
3.2 Changed default value of *cfile* to be :PEP:`3147`-compliant. Previous default was *file* + ``'c'`` (``'o'`` if optimization was enabled). Also added the *optimize* parameter. .. versionchanged:: 3.4 Changed code to use :mod:`importlib` for the byte-code cache file writing. This means file creation/writing semanti...
3.2 Changed default value of *cfile* to be :PEP:`3147`-compliant. Previous default was *file* + ``'c'`` (``'o'`` if optimization was enabled). Also added the *optimize* parameter. .. versionchanged:: 3.4 Changed code to use :mod:`importlib` for the byte-code cache file writing. This means file creation/writing semanti...
python, official-docs, cpython, P0
Local_Trusted_Corpus
77d504e7-82fa-4c53-b4f8-b17c54e2843d
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,750
supabase-export-v2
717b4727c875aa0d
those paths. This is a side-effect of import using file renaming to place the final byte-compiled file into place to prevent concurrent file writing issues. *optimize* controls the optimization level and is passed to the built-in :func:`compile` function. The default of ``-1`` selects the optimization level of the cu...
trusted_official_docs
CPython Docs
those paths. This is a side-effect of import using file renaming to place the final byte-compiled file into place to prevent concurrent file writing issues. *optimize* controls the optimization level and is passed to the built-in :func:`compile` function. The default of ``-1`` selects the optimization level of the cu...
those paths. This is a side-effect of import using file renaming to place the final byte-compiled file into place to prevent concurrent file writing issues. *optimize* controls the optimization level and is passed to the built-in :func:`compile` function. The default of ``-1`` selects the optimization level of the cu...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7cfd5036-d9ec-4b62-8503-241bdde87e45
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,754
supabase-export-v2
1bbc2a9d98317dc0
match what :mod:`importlib` does, e.g. permissions, write-and-move semantics, etc. Also added the caveat that :exc:`FileExistsError` is raised if *cfile* is a symlink or non-regular file. .. versionchanged:: 3.7 The *invalidation_mode* parameter was added as specified in :pep:`552`. If the :envvar:`SOURCE_DATE_EPOCH` ...
trusted_official_docs
CPython Docs
match what :mod:`importlib` does, e.g. permissions, write-and-move semantics, etc. Also added the caveat that :exc:`FileExistsError` is raised if *cfile* is a symlink or non-regular file. .. versionchanged:: 3.7 The *invalidation_mode* parameter was added as specified in :pep:`552`. If the :envvar:`SOURCE_DATE_EPOCH` ...
match what :mod:`importlib` does, e.g. permissions, write-and-move semantics, etc. Also added the caveat that :exc:`FileExistsError` is raised if *cfile* is a symlink or non-regular file. .. versionchanged:: 3.7 The *invalidation_mode* parameter was added as specified in :pep:`552`. If the :envvar:`SOURCE_DATE_EPOCH` ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
932bc903-e250-4c14-bba4-9f796142fa33
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,764
supabase-export-v2
3c93078400dff3a3
.. attribute:: UNCHECKED_HASH Like :attr:`CHECKED_HASH`, the ``.pyc`` file includes a hash of the source file content. However, Python will at runtime assume the ``.pyc`` file is up to date and not validate the ``.pyc`` against the source file at all.
trusted_official_docs
CPython Docs
.. attribute:: UNCHECKED_HASH Like :attr:`CHECKED_HASH`, the ``.pyc`` file includes a hash of the source file content. However, Python will at runtime assume the ``.pyc`` file is up to date and not validate the ``.pyc`` against the source file at all.
.. attribute:: UNCHECKED_HASH Like :attr:`CHECKED_HASH`, the ``.pyc`` file includes a hash of the source file content. However, Python will at runtime assume the ``.pyc`` file is up to date and not validate the ``.pyc`` against the source file at all.
python, official-docs, cpython, P0
Local_Trusted_Corpus
9647854e-f580-422d-bd4d-d8be56e1916f
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,747
supabase-export-v2
1420c96f3bd84535
.. function:: compile(file, cfile=None, dfile=None, doraise=False, optimize=-1, invalidation_mode=PycInvalidationMode.TIMESTAMP, quiet=0) Compile a source file to byte-code and write out the byte-code cache file. The source code is loaded from the file named *file*. The byte-code is written to *cfile*, which defaults ...
trusted_official_docs
CPython Docs
.. function:: compile(file, cfile=None, dfile=None, doraise=False, optimize=-1, invalidation_mode=PycInvalidationMode.TIMESTAMP, quiet=0) Compile a source file to byte-code and write out the byte-code cache file. The source code is loaded from the file named *file*. The byte-code is written to *cfile*, which defaults ...
.. function:: compile(file, cfile=None, dfile=None, doraise=False, optimize=-1, invalidation_mode=PycInvalidationMode.TIMESTAMP, quiet=0) Compile a source file to byte-code and write out the byte-code cache file. The source code is loaded from the file named *file*. The byte-code is written to *cfile*, which defaults ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
9a5ad7f8-4a4a-48ab-abe6-8db1cc07025a
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,752
supabase-export-v2
6fc1edf74eee90c2
how the generated bytecode cache is invalidated at runtime. The default is :attr:`PycInvalidationMode.CHECKED_HASH` if the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, otherwise the default is :attr:`PycInvalidationMode.TIMESTAMP`. .. versionchanged:: 3.2 Changed default value of *cfile* to be :PEP:`3147`-...
trusted_official_docs
CPython Docs
how the generated bytecode cache is invalidated at runtime. The default is :attr:`PycInvalidationMode.CHECKED_HASH` if the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, otherwise the default is :attr:`PycInvalidationMode.TIMESTAMP`. .. versionchanged:: 3.2 Changed default value of *cfile* to be :PEP:`3147`-...
how the generated bytecode cache is invalidated at runtime. The default is :attr:`PycInvalidationMode.CHECKED_HASH` if the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, otherwise the default is :attr:`PycInvalidationMode.TIMESTAMP`. .. versionchanged:: 3.2 Changed default value of *cfile* to be :PEP:`3147`-...
python, official-docs, cpython, P0
Local_Trusted_Corpus
b08a0f74-6cc9-496c-bb9a-ede86fce7bc0
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,760
supabase-export-v2
5f6f0381979a6ca3
.. attribute:: TIMESTAMP The ``.pyc`` file includes the timestamp and size of the source file, which Python will compare against the metadata of the source file at runtime to determine if the ``.pyc`` file needs to be regenerated.
trusted_official_docs
CPython Docs
.. attribute:: TIMESTAMP The ``.pyc`` file includes the timestamp and size of the source file, which Python will compare against the metadata of the source file at runtime to determine if the ``.pyc`` file needs to be regenerated.
.. attribute:: TIMESTAMP The ``.pyc`` file includes the timestamp and size of the source file, which Python will compare against the metadata of the source file at runtime to determine if the ``.pyc`` file needs to be regenerated.
python, official-docs, cpython, P0
Local_Trusted_Corpus
b70b0d9d-e859-40ff-be71-145c4a82a901
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,742
supabase-export-v2
a3b6e2e0262d228f
-------------- The :mod:`!py_compile` module provides a function to generate a byte-code file from a source file, and another function used when the module source file is invoked as a script.
trusted_official_docs
CPython Docs
-------------- The :mod:`!py_compile` module provides a function to generate a byte-code file from a source file, and another function used when the module source file is invoked as a script.
-------------- The :mod:`!py_compile` module provides a function to generate a byte-code file from a source file, and another function used when the module source file is invoked as a script.
python, official-docs, cpython, P0
Local_Trusted_Corpus
c211ad86-88dd-4497-8008-8a35bbf278df
CPython Docs
file://datasets/cpython/Doc/library/py_compile.rst
unknown
5711de6e-350b-4703-83a2-5dbbbd7c8ca9
11,758
supabase-export-v2
b596f0d7675ed278
.. class:: PycInvalidationMode An enumeration of possible methods the interpreter can use to determine whether a bytecode file is up to date with a source file. The ``.pyc`` file indicates the desired invalidation mode in its header. See :ref:`pyc-invalidation` for more information on how Python invalidates ``.pyc`...
trusted_official_docs
CPython Docs
.. class:: PycInvalidationMode An enumeration of possible methods the interpreter can use to determine whether a bytecode file is up to date with a source file. The ``.pyc`` file indicates the desired invalidation mode in its header. See :ref:`pyc-invalidation` for more information on how Python invalidates ``.pyc`...
.. class:: PycInvalidationMode An enumeration of possible methods the interpreter can use to determine whether a bytecode file is up to date with a source file. The ``.pyc`` file indicates the desired invalidation mode in its header. See :ref:`pyc-invalidation` for more information on how Python invalidates ``.pyc`...
python, official-docs, cpython, P0
Local_Trusted_Corpus
01705f5b-6174-4b31-b914-0b91e5bf94d7
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,823
supabase-export-v2
0ea6bb96f43805b7
def static_order(self): self.prepare() while self.is_active(): node_group = self.get_ready() yield from node_group self.done(*node_group) The particular order that is returned may depend on the specific order in which the items were inserted in the graph. For example:
trusted_official_docs
CPython Docs
def static_order(self): self.prepare() while self.is_active(): node_group = self.get_ready() yield from node_group self.done(*node_group) The particular order that is returned may depend on the specific order in which the items were inserted in the graph. For example:
def static_order(self): self.prepare() while self.is_active(): node_group = self.get_ready() yield from node_group self.done(*node_group) The particular order that is returned may depend on the specific order in which the items were inserted in the graph. For example:
python, official-docs, cpython, P0
Local_Trusted_Corpus
07e6f1ad-8a5e-4428-b061-0116875e32b8
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,816
supabase-export-v2
6e0c2c7816207c57
nodes returned by :meth:`TopologicalSorter.get_ready` as processed, unblocking any successor of each node in *nodes* for being returned in the future by a call to :meth:`TopologicalSorter.get_ready`. Raises :exc:`ValueError` if any node in *nodes* has already been marked as processed by a previous call to this method ...
trusted_official_docs
CPython Docs
nodes returned by :meth:`TopologicalSorter.get_ready` as processed, unblocking any successor of each node in *nodes* for being returned in the future by a call to :meth:`TopologicalSorter.get_ready`. Raises :exc:`ValueError` if any node in *nodes* has already been marked as processed by a previous call to this method ...
nodes returned by :meth:`TopologicalSorter.get_ready` as processed, unblocking any successor of each node in *nodes* for being returned in the future by a call to :meth:`TopologicalSorter.get_ready`. Raises :exc:`ValueError` if any node in *nodes* has already been marked as processed by a previous call to this method ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
09a762b0-abe6-425f-8450-680074d363c3
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,803
supabase-export-v2
ea09c675dc2dae87
.. method:: prepare() Mark the graph as finished and check for cycles in the graph. If any cycle is detected, :exc:`CycleError` will be raised, but :meth:`~TopologicalSorter.get_ready` can still be used to obtain as many nodes as possible until cycles block more progress. After a call to this function, the graph ca...
trusted_official_docs
CPython Docs
.. method:: prepare() Mark the graph as finished and check for cycles in the graph. If any cycle is detected, :exc:`CycleError` will be raised, but :meth:`~TopologicalSorter.get_ready` can still be used to obtain as many nodes as possible until cycles block more progress. After a call to this function, the graph ca...
.. method:: prepare() Mark the graph as finished and check for cycles in the graph. If any cycle is detected, :exc:`CycleError` will be raised, but :meth:`~TopologicalSorter.get_ready` can still be used to obtain as many nodes as possible until cycles block more progress. After a call to this function, the graph ca...
python, official-docs, cpython, P0
Local_Trusted_Corpus
09cd96cf-0c48-4870-bd7c-f3c2894e8b7b
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,821
supabase-export-v2
acc0f0fa9f06ac83
.. method:: static_order() Returns an iterator object which will iterate over nodes in a topological order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:`~TopologicalSorter.done` should not be called. This method is equivalent to::
trusted_official_docs
CPython Docs
.. method:: static_order() Returns an iterator object which will iterate over nodes in a topological order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:`~TopologicalSorter.done` should not be called. This method is equivalent to::
.. method:: static_order() Returns an iterator object which will iterate over nodes in a topological order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:`~TopologicalSorter.done` should not be called. This method is equivalent to::
python, official-docs, cpython, P0
Local_Trusted_Corpus
0a8ef68c-5f2c-42c2-9913-9ec8992f0208
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,827
supabase-export-v2
f779b4a96c935a44
>>> ts2 = TopologicalSorter() >>> ts2.add(1, 0) >>> ts2.add(3, 2, 1) >>> print([*ts2.static_order()]) [0, 2, 1, 3] This is due to the fact that "0" and "2" are in the same level in the graph (they would have been returned in the same call to :meth:`~TopologicalSorter.get_ready`) and the order between them is determi...
trusted_official_docs
CPython Docs
>>> ts2 = TopologicalSorter() >>> ts2.add(1, 0) >>> ts2.add(3, 2, 1) >>> print([*ts2.static_order()]) [0, 2, 1, 3] This is due to the fact that "0" and "2" are in the same level in the graph (they would have been returned in the same call to :meth:`~TopologicalSorter.get_ready`) and the order between them is determi...
>>> ts2 = TopologicalSorter() >>> ts2.add(1, 0) >>> ts2.add(3, 2, 1) >>> print([*ts2.static_order()]) [0, 2, 1, 3] This is due to the fact that "0" and "2" are in the same level in the graph (they would have been returned in the same call to :meth:`~TopologicalSorter.get_ready`) and the order between them is determi...
python, official-docs, cpython, P0
Local_Trusted_Corpus
102526ef-fc7b-481b-b5e4-12873bd944a3
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,801
supabase-export-v2
cb2aa0c9cb3d3fb2
node that has not been provided before is included among *predecessors* it will be automatically added to the graph with no predecessors of its own. Raises :exc:`ValueError` if called after :meth:`~TopologicalSorter.prepare`.
trusted_official_docs
CPython Docs
node that has not been provided before is included among *predecessors* it will be automatically added to the graph with no predecessors of its own. Raises :exc:`ValueError` if called after :meth:`~TopologicalSorter.prepare`.
node that has not been provided before is included among *predecessors* it will be automatically added to the graph with no predecessors of its own. Raises :exc:`ValueError` if called after :meth:`~TopologicalSorter.prepare`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
16d04269-8ea5-4ada-a27b-c4dfe2086f52
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,792
supabase-export-v2
aa2e31f98ad7e91c
>>> graph = {"D": {"B", "C"}, "C": {"A"}, "B": {"A"}} >>> ts = TopologicalSorter(graph) >>> tuple(ts.static_order()) ('A', 'C', 'B', 'D') The class is designed to easily support parallel processing of the nodes as they become ready. For instance::
trusted_official_docs
CPython Docs
>>> graph = {"D": {"B", "C"}, "C": {"A"}, "B": {"A"}} >>> ts = TopologicalSorter(graph) >>> tuple(ts.static_order()) ('A', 'C', 'B', 'D') The class is designed to easily support parallel processing of the nodes as they become ready. For instance::
>>> graph = {"D": {"B", "C"}, "C": {"A"}, "B": {"A"}} >>> ts = TopologicalSorter(graph) >>> tuple(ts.static_order()) ('A', 'C', 'B', 'D') The class is designed to easily support parallel processing of the nodes as they become ready. For instance::
python, official-docs, cpython, P0
Local_Trusted_Corpus
17001b24-0155-4bbe-a5b6-27d10f70baee
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,786
supabase-export-v2
c12157ccec2f3b89
A complete topological ordering is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic graph. If the optional *graph* argument is provided it must be a dictionary representing a directed acyclic graph where the keys are nodes and the values are iterables of all predecessors ...
trusted_official_docs
CPython Docs
A complete topological ordering is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic graph. If the optional *graph* argument is provided it must be a dictionary representing a directed acyclic graph where the keys are nodes and the values are iterables of all predecessors ...
A complete topological ordering is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic graph. If the optional *graph* argument is provided it must be a dictionary representing a directed acyclic graph where the keys are nodes and the values are iterables of all predecessors ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
2f9d9704-9568-439c-b4f0-d16329813a7e
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,818
supabase-export-v2
5da8273ddf458a78
.. method:: get_ready() Returns a ``tuple`` with all the nodes that are ready. Initially it returns all nodes with no predecessors, and once those are marked as processed by calling :meth:`TopologicalSorter.done`, further calls will return all new nodes that have all their predecessors already processed. Once no mor...
trusted_official_docs
CPython Docs
.. method:: get_ready() Returns a ``tuple`` with all the nodes that are ready. Initially it returns all nodes with no predecessors, and once those are marked as processed by calling :meth:`TopologicalSorter.done`, further calls will return all new nodes that have all their predecessors already processed. Once no mor...
.. method:: get_ready() Returns a ``tuple`` with all the nodes that are ready. Initially it returns all nodes with no predecessors, and once those are marked as processed by calling :meth:`TopologicalSorter.done`, further calls will return all new nodes that have all their predecessors already processed. Once no mor...
python, official-docs, cpython, P0
Local_Trusted_Corpus
3eb9027d-a479-4216-9eae-53674a0ad943
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,822
supabase-export-v2
9d6e9324f8b4e110
which will iterate over nodes in a topological order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:`~TopologicalSorter.done` should not be called. This method is equivalent to:: def static_order(self): self.prepare() while self.is_active(): node_group = self.get_ready() yield from node_group...
trusted_official_docs
CPython Docs
which will iterate over nodes in a topological order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:`~TopologicalSorter.done` should not be called. This method is equivalent to:: def static_order(self): self.prepare() while self.is_active(): node_group = self.get_ready() yield from node_group...
which will iterate over nodes in a topological order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:`~TopologicalSorter.done` should not be called. This method is equivalent to:: def static_order(self): self.prepare() while self.is_active(): node_group = self.get_ready() yield from node_group...
python, official-docs, cpython, P0
Local_Trusted_Corpus
540199b1-1f4e-43ec-a911-01f6ecd5389a
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,799
supabase-export-v2
c89ef704e1af7ca3
Add a new node and its predecessors to the graph. Both the *node* and all elements in *predecessors* must be :term:`hashable`. If called multiple times with the same node argument, the set of dependencies will be the union of all dependencies passed in.
trusted_official_docs
CPython Docs
Add a new node and its predecessors to the graph. Both the *node* and all elements in *predecessors* must be :term:`hashable`. If called multiple times with the same node argument, the set of dependencies will be the union of all dependencies passed in.
Add a new node and its predecessors to the graph. Both the *node* and all elements in *predecessors* must be :term:`hashable`. If called multiple times with the same node argument, the set of dependencies will be the union of all dependencies passed in.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5d8b2542-ad02-4efd-981c-42e164dca7d6
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,815
supabase-export-v2
6871ac996bb0d1c8
.. method:: done(*nodes) Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as processed, unblocking any successor of each node in *nodes* for being returned in the future by a call to :meth:`TopologicalSorter.get_ready`.
trusted_official_docs
CPython Docs
.. method:: done(*nodes) Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as processed, unblocking any successor of each node in *nodes* for being returned in the future by a call to :meth:`TopologicalSorter.get_ready`.
.. method:: done(*nodes) Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as processed, unblocking any successor of each node in *nodes* for being returned in the future by a call to :meth:`TopologicalSorter.get_ready`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5ef8d3ce-d1cf-4014-9dce-09fb972e9c4d
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,826
supabase-export-v2
f943c6a153c79368
>>> ts = TopologicalSorter() >>> ts.add(3, 2, 1) >>> ts.add(1, 0) >>> print([*ts.static_order()]) [2, 0, 1, 3] >>> ts2 = TopologicalSorter() >>> ts2.add(1, 0) >>> ts2.add(3, 2, 1) >>> print([*ts2.static_order()]) [0, 2, 1, 3]
trusted_official_docs
CPython Docs
>>> ts = TopologicalSorter() >>> ts.add(3, 2, 1) >>> ts.add(1, 0) >>> print([*ts.static_order()]) [2, 0, 1, 3] >>> ts2 = TopologicalSorter() >>> ts2.add(1, 0) >>> ts2.add(3, 2, 1) >>> print([*ts2.static_order()]) [0, 2, 1, 3]
>>> ts = TopologicalSorter() >>> ts.add(3, 2, 1) >>> ts.add(1, 0) >>> print([*ts.static_order()]) [2, 0, 1, 3] >>> ts2 = TopologicalSorter() >>> ts2.add(1, 0) >>> ts2.add(3, 2, 1) >>> print([*ts2.static_order()]) [0, 2, 1, 3]
python, official-docs, cpython, P0
Local_Trusted_Corpus
615b15dc-1679-4130-aa7c-7e3da66dd01a
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,804
supabase-export-v2
ab5a7a4ed5296b8b
cycles block more progress. After a call to this function, the graph cannot be modified, and therefore no more nodes can be added using :meth:`~TopologicalSorter.add`. A :exc:`ValueError` will be raised if the sort has been started by :meth:`~.static_order` or :meth:`~.get_ready`.
trusted_official_docs
CPython Docs
cycles block more progress. After a call to this function, the graph cannot be modified, and therefore no more nodes can be added using :meth:`~TopologicalSorter.add`. A :exc:`ValueError` will be raised if the sort has been started by :meth:`~.static_order` or :meth:`~.get_ready`.
cycles block more progress. After a call to this function, the graph cannot be modified, and therefore no more nodes can be added using :meth:`~TopologicalSorter.add`. A :exc:`ValueError` will be raised if the sort has been started by :meth:`~.static_order` or :meth:`~.get_ready`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
64713bb7-043e-4f2f-acc2-6e2b2f859873
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,785
supabase-export-v2
8880c24d5ea32616
Provides functionality to topologically sort a graph of :term:`hashable` nodes. A topological order is a linear ordering of the vertices in a graph such that for every directed edge u -> v from vertex u to vertex v, vertex u comes before vertex v in the ordering. For instance, the vertices of the graph may represent...
trusted_official_docs
CPython Docs
Provides functionality to topologically sort a graph of :term:`hashable` nodes. A topological order is a linear ordering of the vertices in a graph such that for every directed edge u -> v from vertex u to vertex v, vertex u comes before vertex v in the ordering. For instance, the vertices of the graph may represent...
Provides functionality to topologically sort a graph of :term:`hashable` nodes. A topological order is a linear ordering of the vertices in a graph such that for every directed edge u -> v from vertex u to vertex v, vertex u comes before vertex v in the ordering. For instance, the vertices of the graph may represent...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6ca492d6-7e70-4de0-b12c-15e82bd367e5
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,833
supabase-export-v2
69c160cc8eb29af0
if cycles exist in the working graph. If multiple cycles exist, only one undefined choice among them will be reported and included in the exception. The detected cycle can be accessed via the second element in the :attr:`~BaseException.args` attribute of the exception instance and consists in a list of nodes, such tha...
trusted_official_docs
CPython Docs
if cycles exist in the working graph. If multiple cycles exist, only one undefined choice among them will be reported and included in the exception. The detected cycle can be accessed via the second element in the :attr:`~BaseException.args` attribute of the exception instance and consists in a list of nodes, such tha...
if cycles exist in the working graph. If multiple cycles exist, only one undefined choice among them will be reported and included in the exception. The detected cycle can be accessed via the second element in the :attr:`~BaseException.args` attribute of the exception instance and consists in a list of nodes, such tha...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7f846e76-147c-483b-ace0-e1e9d4881482
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,787
supabase-export-v2
d06dfaaf214db96b
(the nodes that have edges that point to the value in the key). Additional nodes can be added to the graph using the :meth:`~TopologicalSorter.add` method. In the general case, the steps required to perform the sorting of a given graph are as follows:
trusted_official_docs
CPython Docs
(the nodes that have edges that point to the value in the key). Additional nodes can be added to the graph using the :meth:`~TopologicalSorter.add` method. In the general case, the steps required to perform the sorting of a given graph are as follows:
(the nodes that have edges that point to the value in the key). Additional nodes can be added to the graph using the :meth:`~TopologicalSorter.add` method. In the general case, the steps required to perform the sorting of a given graph are as follows:
python, official-docs, cpython, P0
Local_Trusted_Corpus
81b56b46-0ec1-4fbc-83dd-32ea9a33c890
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,819
supabase-export-v2
b319ed9a5081e2a9
further calls will return all new nodes that have all their predecessors already processed. Once no more progress can be made, empty tuples are returned. Raises :exc:`ValueError` if called without calling :meth:`~TopologicalSorter.prepare` previously.
trusted_official_docs
CPython Docs
further calls will return all new nodes that have all their predecessors already processed. Once no more progress can be made, empty tuples are returned. Raises :exc:`ValueError` if called without calling :meth:`~TopologicalSorter.prepare` previously.
further calls will return all new nodes that have all their predecessors already processed. Once no more progress can be made, empty tuples are returned. Raises :exc:`ValueError` if called without calling :meth:`~TopologicalSorter.prepare` previously.
python, official-docs, cpython, P0
Local_Trusted_Corpus
aa1465b6-53e6-4f87-b73d-f300f049a24b
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,809
supabase-export-v2
5ac13e35c1c95bad
that haven't yet been returned by :meth:`TopologicalSorter.get_ready` or the number of nodes marked :meth:`TopologicalSorter.done` is less than the number that have been returned by :meth:`TopologicalSorter.get_ready`. The :meth:`~object.__bool__` method of this class defers to this function, so instead of::
trusted_official_docs
CPython Docs
that haven't yet been returned by :meth:`TopologicalSorter.get_ready` or the number of nodes marked :meth:`TopologicalSorter.done` is less than the number that have been returned by :meth:`TopologicalSorter.get_ready`. The :meth:`~object.__bool__` method of this class defers to this function, so instead of::
that haven't yet been returned by :meth:`TopologicalSorter.get_ready` or the number of nodes marked :meth:`TopologicalSorter.done` is less than the number that have been returned by :meth:`TopologicalSorter.get_ready`. The :meth:`~object.__bool__` method of this class defers to this function, so instead of::
python, official-docs, cpython, P0
Local_Trusted_Corpus
b93a6f9a-b88d-4d7c-8595-4df2dc8f7b61
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,808
supabase-export-v2
d33204c357e70cf8
.. method:: is_active() Returns ``True`` if more progress can be made and ``False`` otherwise. Progress can be made if cycles do not block the resolution and either there are still nodes ready that haven't yet been returned by :meth:`TopologicalSorter.get_ready` or the number of nodes marked :meth:`TopologicalSorter...
trusted_official_docs
CPython Docs
.. method:: is_active() Returns ``True`` if more progress can be made and ``False`` otherwise. Progress can be made if cycles do not block the resolution and either there are still nodes ready that haven't yet been returned by :meth:`TopologicalSorter.get_ready` or the number of nodes marked :meth:`TopologicalSorter...
.. method:: is_active() Returns ``True`` if more progress can be made and ``False`` otherwise. Progress can be made if cycles do not block the resolution and either there are still nodes ready that haven't yet been returned by :meth:`TopologicalSorter.get_ready` or the number of nodes marked :meth:`TopologicalSorter...
python, official-docs, cpython, P0
Local_Trusted_Corpus
c16a6ca9-79f1-426a-a044-c40d4d4ccc25
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,832
supabase-export-v2
61e4a7af97081813
.. exception:: CycleError Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if cycles exist in the working graph. If multiple cycles exist, only one undefined choice among them will be reported and included in the exception.
trusted_official_docs
CPython Docs
.. exception:: CycleError Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if cycles exist in the working graph. If multiple cycles exist, only one undefined choice among them will be reported and included in the exception.
.. exception:: CycleError Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if cycles exist in the working graph. If multiple cycles exist, only one undefined choice among them will be reported and included in the exception.
python, official-docs, cpython, P0
Local_Trusted_Corpus
d0e36c9a-8e90-49f7-b145-268b7fd8e807
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,800
supabase-export-v2
abe1db8cfe6e1d1f
If called multiple times with the same node argument, the set of dependencies will be the union of all dependencies passed in. It is possible to add a node with no dependencies (*predecessors* is not provided) or to provide a dependency twice. If a node that has not been provided before is included among *predecessor...
trusted_official_docs
CPython Docs
If called multiple times with the same node argument, the set of dependencies will be the union of all dependencies passed in. It is possible to add a node with no dependencies (*predecessors* is not provided) or to provide a dependency twice. If a node that has not been provided before is included among *predecessor...
If called multiple times with the same node argument, the set of dependencies will be the union of all dependencies passed in. It is possible to add a node with no dependencies (*predecessors* is not provided) or to provide a dependency twice. If a node that has not been provided before is included among *predecessor...
python, official-docs, cpython, P0
Local_Trusted_Corpus
dd60d177-9a44-4b42-bec9-8422d333afc2
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,789
supabase-export-v2
be2e25d3a8646752
graph. * While :meth:`~TopologicalSorter.is_active` is ``True``, iterate over the nodes returned by :meth:`~TopologicalSorter.get_ready` and process them. Call :meth:`~TopologicalSorter.done` on each node as it finishes processing. In case just an immediate sorting of the nodes in the graph is required and no parallel...
trusted_official_docs
CPython Docs
graph. * While :meth:`~TopologicalSorter.is_active` is ``True``, iterate over the nodes returned by :meth:`~TopologicalSorter.get_ready` and process them. Call :meth:`~TopologicalSorter.done` on each node as it finishes processing. In case just an immediate sorting of the nodes in the graph is required and no parallel...
graph. * While :meth:`~TopologicalSorter.is_active` is ``True``, iterate over the nodes returned by :meth:`~TopologicalSorter.get_ready` and process them. Call :meth:`~TopologicalSorter.done` on each node as it finishes processing. In case just an immediate sorting of the nodes in the graph is required and no parallel...
python, official-docs, cpython, P0
Local_Trusted_Corpus
eb925844-34b0-4a50-b9bc-d661993bb28d
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,796
supabase-export-v2
c2786c55d83c3e1d
topological_sorter.prepare() while topological_sorter.is_active(): for node in topological_sorter.get_ready(): # Worker threads or processes take nodes to work on off the # 'task_queue' queue. task_queue.put(node) # When the work for a node is done, workers put the node in # 'finalized_tasks_queue' so we can get more ...
trusted_official_docs
CPython Docs
topological_sorter.prepare() while topological_sorter.is_active(): for node in topological_sorter.get_ready(): # Worker threads or processes take nodes to work on off the # 'task_queue' queue. task_queue.put(node) # When the work for a node is done, workers put the node in # 'finalized_tasks_queue' so we can get more ...
topological_sorter.prepare() while topological_sorter.is_active(): for node in topological_sorter.get_ready(): # Worker threads or processes take nodes to work on off the # 'task_queue' queue. task_queue.put(node) # When the work for a node is done, workers put the node in # 'finalized_tasks_queue' so we can get more ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
ef581e32-7573-4cc9-a8c2-4597a449175b
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,828
supabase-export-v2
afc3564b28bc1a5d
the graph (they would have been returned in the same call to :meth:`~TopologicalSorter.get_ready`) and the order between them is determined by the order of insertion. If any cycle is detected, :exc:`CycleError` will be raised.
trusted_official_docs
CPython Docs
the graph (they would have been returned in the same call to :meth:`~TopologicalSorter.get_ready`) and the order between them is determined by the order of insertion. If any cycle is detected, :exc:`CycleError` will be raised.
the graph (they would have been returned in the same call to :meth:`~TopologicalSorter.get_ready`) and the order between them is determined by the order of insertion. If any cycle is detected, :exc:`CycleError` will be raised.
python, official-docs, cpython, P0
Local_Trusted_Corpus
f93c0a38-c263-4aae-8be3-0470befc7bcf
CPython Docs
file://datasets/cpython/Doc/library/graphlib.rst
unknown
7c4427a3-9173-4b84-9f3a-067bd7440176
11,788
supabase-export-v2
86bd4d9bd841b14f
In the general case, the steps required to perform the sorting of a given graph are as follows: * Create an instance of the :class:`TopologicalSorter` with an optional initial graph. * Add additional nodes to the graph. * Call :meth:`~TopologicalSorter.prepare` on the graph. * While :meth:`~TopologicalSorter.is_active...
trusted_official_docs
CPython Docs
In the general case, the steps required to perform the sorting of a given graph are as follows: * Create an instance of the :class:`TopologicalSorter` with an optional initial graph. * Add additional nodes to the graph. * Call :meth:`~TopologicalSorter.prepare` on the graph. * While :meth:`~TopologicalSorter.is_active...
In the general case, the steps required to perform the sorting of a given graph are as follows: * Create an instance of the :class:`TopologicalSorter` with an optional initial graph. * Add additional nodes to the graph. * Call :meth:`~TopologicalSorter.prepare` on the graph. * While :meth:`~TopologicalSorter.is_active...
python, official-docs, cpython, P0
Local_Trusted_Corpus
021ee675-af94-4f6f-aae3-5db87d7a77cf
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
12,033
supabase-export-v2
fdcbca0220bee8ca
* *named* -- This group matches the unbraced placeholder name; it should not include the delimiter in capturing group. * *braced* -- This group matches the brace enclosed placeholder name; it should not include either the delimiter or braces in the capturing group.
trusted_official_docs
CPython Docs
* *named* -- This group matches the unbraced placeholder name; it should not include the delimiter in capturing group. * *braced* -- This group matches the brace enclosed placeholder name; it should not include either the delimiter or braces in the capturing group.
* *named* -- This group matches the unbraced placeholder name; it should not include the delimiter in capturing group. * *braced* -- This group matches the brace enclosed placeholder name; it should not include either the delimiter or braces in the capturing group.
python, official-docs, cpython, P0
Local_Trusted_Corpus
02d1e5e8-a484-44bf-8a03-720e22ef3fba
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,977
supabase-export-v2
71f99a5cd171aff9
aligned') 'left aligned ' >>> '{:>30}'.format('right aligned') ' right aligned' >>> '{:^30}'.format('centered') ' centered ' >>> '{:*^30}'.format('centered') # use '*' as a fill char '***********centered***********' Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::
trusted_official_docs
CPython Docs
aligned') 'left aligned ' >>> '{:>30}'.format('right aligned') ' right aligned' >>> '{:^30}'.format('centered') ' centered ' >>> '{:*^30}'.format('centered') # use '*' as a fill char '***********centered***********' Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::
aligned') 'left aligned ' >>> '{:>30}'.format('right aligned') ' right aligned' >>> '{:^30}'.format('centered') ' centered ' >>> '{:*^30}'.format('centered') # use '*' as a fill char '***********centered***********' Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::
python, official-docs, cpython, P0
Local_Trusted_Corpus
07a91c7b-5c05-43f4-b5b5-394718e7055e
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,894
supabase-export-v2
e469f43f53f46dfb
dictionary keys (e.g., the strings ``'10'`` or ``':-]'``) within a format string. The *arg_name* can be followed by any number of index or attribute expressions. An expression of the form ``'.name'`` selects the named attribute using :func:`getattr`, while an expression of the form ``'[index]'`` does an index lookup us...
trusted_official_docs
CPython Docs
dictionary keys (e.g., the strings ``'10'`` or ``':-]'``) within a format string. The *arg_name* can be followed by any number of index or attribute expressions. An expression of the form ``'.name'`` selects the named attribute using :func:`getattr`, while an expression of the form ``'[index]'`` does an index lookup us...
dictionary keys (e.g., the strings ``'10'`` or ``':-]'``) within a format string. The *arg_name* can be followed by any number of index or attribute expressions. An expression of the form ``'.name'`` selects the named attribute using :func:`getattr`, while an expression of the form ``'[index]'`` does an index lookup us...
python, official-docs, cpython, P0
Local_Trusted_Corpus
096f3694-b713-4025-96aa-7c9ee583502e
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,948
supabase-export-v2
ac9843d09ee5534b
floating-point presentation types listed below (except ``'n'`` and ``None``). When doing so, :func:`float` is used to convert the integer to a floating-point number before formatting. The available presentation types for :class:`float` and :class:`~decimal.Decimal` values are:
trusted_official_docs
CPython Docs
floating-point presentation types listed below (except ``'n'`` and ``None``). When doing so, :func:`float` is used to convert the integer to a floating-point number before formatting. The available presentation types for :class:`float` and :class:`~decimal.Decimal` values are:
floating-point presentation types listed below (except ``'n'`` and ``None``). When doing so, :func:`float` is used to convert the integer to a floating-point number before formatting. The available presentation types for :class:`float` and :class:`~decimal.Decimal` values are:
python, official-docs, cpython, P0
Local_Trusted_Corpus
0ac4356b-52f7-4e53-bc77-2e47fb5d44d6
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,871
supabase-export-v2
0bfc2944832802a1
.. method:: get_field(field_name, args, kwargs) Given *field_name*, convert it to an object to be formatted. Auto-numbering of *field_name* returned from :meth:`parse` is done by :meth:`vformat` before calling this method. Returns a tuple (obj, used_key). The default version takes strings of the form defined in :pep:`...
trusted_official_docs
CPython Docs
.. method:: get_field(field_name, args, kwargs) Given *field_name*, convert it to an object to be formatted. Auto-numbering of *field_name* returned from :meth:`parse` is done by :meth:`vformat` before calling this method. Returns a tuple (obj, used_key). The default version takes strings of the form defined in :pep:`...
.. method:: get_field(field_name, args, kwargs) Given *field_name*, convert it to an object to be formatted. Auto-numbering of *field_name* returned from :meth:`parse` is done by :meth:`vformat` before calling this method. Returns a tuple (obj, used_key). The default version takes strings of the form defined in :pep:`...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0d2b5be4-dc0a-4736-8be7-9d749a7639ec
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,966
supabase-export-v2
a281b935baebd488
Accessing arguments by position:: >>> '{0}, {1}, {2}'.format('a', 'b', 'c') 'a, b, c' >>> '{}, {}, {}'.format('a', 'b', 'c') # 3.1+ only 'a, b, c' >>> '{2}, {1}, {0}'.format('a', 'b', 'c') 'c, b, a' >>> '{2}, {1}, {0}'.format(*'abc') # unpacking argument sequence 'c, b, a' >>> '{0}{1}{0}'.format('abra', 'cad') ...
trusted_official_docs
CPython Docs
Accessing arguments by position:: >>> '{0}, {1}, {2}'.format('a', 'b', 'c') 'a, b, c' >>> '{}, {}, {}'.format('a', 'b', 'c') # 3.1+ only 'a, b, c' >>> '{2}, {1}, {0}'.format('a', 'b', 'c') 'c, b, a' >>> '{2}, {1}, {0}'.format(*'abc') # unpacking argument sequence 'c, b, a' >>> '{0}{1}{0}'.format('abra', 'cad') ...
Accessing arguments by position:: >>> '{0}, {1}, {2}'.format('a', 'b', 'c') 'a, b, c' >>> '{}, {}, {}'.format('a', 'b', 'c') # 3.1+ only 'a, b, c' >>> '{2}, {1}, {0}'.format('a', 'b', 'c') 'c, b, a' >>> '{2}, {1}, {0}'.format(*'abc') # unpacking argument sequence 'c, b, a' >>> '{0}{1}{0}'.format('abra', 'cad') ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0f7e0e72-b8b6-4c62-98f0-b1ebc05246f5
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,953
supabase-export-v2
124255a467906a96
are as follows: suppose that the | | | result formatted with presentation type ``'e'`` and | | | precision ``p-1`` would have exponent ``exp``. Then, | | | if ``m <= exp < p``, where ``m`` is -4 for floats and -6 | | | for :class:`Decimals <decimal.Decimal>`, the number is | | | formatted with presentation type ``'f...
trusted_official_docs
CPython Docs
are as follows: suppose that the | | | result formatted with presentation type ``'e'`` and | | | precision ``p-1`` would have exponent ``exp``. Then, | | | if ``m <= exp < p``, where ``m`` is -4 for floats and -6 | | | for :class:`Decimals <decimal.Decimal>`, the number is | | | formatted with presentation type ``'f...
are as follows: suppose that the | | | result formatted with presentation type ``'e'`` and | | | precision ``p-1`` would have exponent ``exp``. Then, | | | if ``m <= exp < p``, where ``m`` is -4 for floats and -6 | | | for :class:`Decimals <decimal.Decimal>`, the number is | | | formatted with presentation type ``'f...
python, official-docs, cpython, P0
Local_Trusted_Corpus
0ffb35c7-a9ef-4c16-9888-e76fc10b1e45
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,947
supabase-export-v2
6130551eae6911b5
the current locale setting to insert the appropriate | | | digit group separators. | +---------+----------------------------------------------------------+ | None | The same as ``'d'``. | +---------+----------------------------------------------------------+ In addition to the above presentation types, integers can be ...
trusted_official_docs
CPython Docs
the current locale setting to insert the appropriate | | | digit group separators. | +---------+----------------------------------------------------------+ | None | The same as ``'d'``. | +---------+----------------------------------------------------------+ In addition to the above presentation types, integers can be ...
the current locale setting to insert the appropriate | | | digit group separators. | +---------+----------------------------------------------------------+ | None | The same as ``'d'``. | +---------+----------------------------------------------------------+ In addition to the above presentation types, integers can be ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
10ef348a-4148-4db8-8bb8-e969e6ba69f6
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,910
supabase-export-v2
08b867dbf7309df1
Format specification mini-language ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "Format specifications" are used within replacement fields contained within a format string to define how individual values are presented (see :ref:`formatstrings`, :ref:`f-strings`, and :ref:`t-strings`). They can also be passed directly to the buil...
trusted_official_docs
CPython Docs
Format specification mini-language ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "Format specifications" are used within replacement fields contained within a format string to define how individual values are presented (see :ref:`formatstrings`, :ref:`f-strings`, and :ref:`t-strings`). They can also be passed directly to the buil...
Format specification mini-language ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "Format specifications" are used within replacement fields contained within a format string to define how individual values are presented (see :ref:`formatstrings`, :ref:`f-strings`, and :ref:`t-strings`). They can also be passed directly to the buil...
python, official-docs, cpython, P0
Local_Trusted_Corpus
15ba2648-9b55-4286-86fa-6b61623d89a5
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,976
supabase-export-v2
31c8f9d7c131d63e
Aligning the text and specifying a width:: >>> '{:<30}'.format('left aligned') 'left aligned ' >>> '{:>30}'.format('right aligned') ' right aligned' >>> '{:^30}'.format('centered') ' centered ' >>> '{:*^30}'.format('centered') # use '*' as a fill char '***********centered***********'
trusted_official_docs
CPython Docs
Aligning the text and specifying a width:: >>> '{:<30}'.format('left aligned') 'left aligned ' >>> '{:>30}'.format('right aligned') ' right aligned' >>> '{:^30}'.format('centered') ' centered ' >>> '{:*^30}'.format('centered') # use '*' as a fill char '***********centered***********'
Aligning the text and specifying a width:: >>> '{:<30}'.format('left aligned') 'left aligned ' >>> '{:>30}'.format('right aligned') ' right aligned' >>> '{:^30}'.format('centered') ' centered ' >>> '{:*^30}'.format('centered') # use '*' as a fill char '***********centered***********'
python, official-docs, cpython, P0
Local_Trusted_Corpus
15f7606a-2990-45c1-953b-27e5df27b720
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,970
supabase-export-v2
b35a8606993e825e
Accessing arguments' attributes:: >>> c = 3-5j >>> ('The complex number {0} is formed from the real part {0.real} ' ... 'and the imaginary part {0.imag}.').format(c) 'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.' >>> class Point: ... def __init__(self, x, y): ... self.x,...
trusted_official_docs
CPython Docs
Accessing arguments' attributes:: >>> c = 3-5j >>> ('The complex number {0} is formed from the real part {0.real} ' ... 'and the imaginary part {0.imag}.').format(c) 'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.' >>> class Point: ... def __init__(self, x, y): ... self.x,...
Accessing arguments' attributes:: >>> c = 3-5j >>> ('The complex number {0} is formed from the real part {0.real} ' ... 'and the imaginary part {0.imag}.').format(c) 'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.' >>> class Point: ... def __init__(self, x, y): ... self.x,...
python, official-docs, cpython, P0
Local_Trusted_Corpus
19f24661-13a9-4f94-9778-a97576d34d62
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
12,026
supabase-export-v2
4a9f87f36093e154
.. versionchanged:: 3.7 *braceidpattern* can be used to define separate patterns used inside and outside the braces. * *braceidpattern* -- This is like *idpattern* but describes the pattern for braced placeholders. Defaults to ``None`` which means to fall back to *idpattern* (i.e. the same pattern is used both inside...
trusted_official_docs
CPython Docs
.. versionchanged:: 3.7 *braceidpattern* can be used to define separate patterns used inside and outside the braces. * *braceidpattern* -- This is like *idpattern* but describes the pattern for braced placeholders. Defaults to ``None`` which means to fall back to *idpattern* (i.e. the same pattern is used both inside...
.. versionchanged:: 3.7 *braceidpattern* can be used to define separate patterns used inside and outside the braces. * *braceidpattern* -- This is like *idpattern* but describes the pattern for braced placeholders. Defaults to ``None`` which means to fall back to *idpattern* (i.e. the same pattern is used both inside...
python, official-docs, cpython, P0
Local_Trusted_Corpus
1d0a7c88-c708-4049-96f8-006f393fc6e5
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,963
supabase-export-v2
71bfba2df091f603
This section contains examples of the :meth:`str.format` syntax and comparison with the old ``%``-formatting. In most of the cases the syntax is similar to the old ``%``-formatting, with the addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``.
trusted_official_docs
CPython Docs
This section contains examples of the :meth:`str.format` syntax and comparison with the old ``%``-formatting. In most of the cases the syntax is similar to the old ``%``-formatting, with the addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``.
This section contains examples of the :meth:`str.format` syntax and comparison with the old ``%``-formatting. In most of the cases the syntax is similar to the old ``%``-formatting, with the addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
1f9b2bee-3901-45cc-8706-e66fdcefe793
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,946
supabase-export-v2
56d8bb77d064bd7e
the number in base 10. | +---------+----------------------------------------------------------+ | ``'o'`` | Octal format. Outputs the number in base 8. | +---------+----------------------------------------------------------+ | ``'x'`` | Hex format. Outputs the number in base 16, using | | | lower-case letters for the ...
trusted_official_docs
CPython Docs
the number in base 10. | +---------+----------------------------------------------------------+ | ``'o'`` | Octal format. Outputs the number in base 8. | +---------+----------------------------------------------------------+ | ``'x'`` | Hex format. Outputs the number in base 16, using | | | lower-case letters for the ...
the number in base 10. | +---------+----------------------------------------------------------+ | ``'o'`` | Octal format. Outputs the number in base 8. | +---------+----------------------------------------------------------+ | ``'x'`` | Hex format. Outputs the number in base 16, using | | | lower-case letters for the ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
21a0495e-f11c-49bd-b90d-a7b700df4abe
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,905
supabase-export-v2
4f7f63e5a996e035
details as field width, alignment, padding, decimal precision and so on. Each value type can define its own "formatting mini-language" or interpretation of the *format_spec*. Most built-in types support a common formatting mini-language, which is described in the next section.
trusted_official_docs
CPython Docs
details as field width, alignment, padding, decimal precision and so on. Each value type can define its own "formatting mini-language" or interpretation of the *format_spec*. Most built-in types support a common formatting mini-language, which is described in the next section.
details as field width, alignment, padding, decimal precision and so on. Each value type can define its own "formatting mini-language" or interpretation of the *format_spec*. Most built-in types support a common formatting mini-language, which is described in the next section.
python, official-docs, cpython, P0
Local_Trusted_Corpus
22b3e65c-02a6-49d8-8a5c-b2f3bf9af890
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,862
supabase-export-v2
34fc922eb047c5cf
.. method:: format(format_string, /, *args, **kwargs) The primary API method. It takes a format string and an arbitrary set of positional and keyword arguments. It is just a wrapper that calls :meth:`vformat`.
trusted_official_docs
CPython Docs
.. method:: format(format_string, /, *args, **kwargs) The primary API method. It takes a format string and an arbitrary set of positional and keyword arguments. It is just a wrapper that calls :meth:`vformat`.
.. method:: format(format_string, /, *args, **kwargs) The primary API method. It takes a format string and an arbitrary set of positional and keyword arguments. It is just a wrapper that calls :meth:`vformat`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
257b4a21-8d64-4fdd-ba66-87e45c6d6d2a
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,912
supabase-export-v2
5dee27a9b5be252c
Most built-in types implement the following options for format specifications, although some of the formatting options are only supported by the numeric types. A general convention is that an empty format specification produces the same result as if you had called :func:`str` on the value. A non-empty format specificat...
trusted_official_docs
CPython Docs
Most built-in types implement the following options for format specifications, although some of the formatting options are only supported by the numeric types. A general convention is that an empty format specification produces the same result as if you had called :func:`str` on the value. A non-empty format specificat...
Most built-in types implement the following options for format specifications, although some of the formatting options are only supported by the numeric types. A general convention is that an empty format specification produces the same result as if you had called :func:`str` on the value. A non-empty format specificat...
python, official-docs, cpython, P0
Local_Trusted_Corpus
25eabad2-bb6f-4094-be9d-01aa10df845a
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,868
supabase-export-v2
30ebdb85f3f7331c
.. method:: parse(format_string) Loop over the format_string and return an iterable of tuples (*literal_text*, *field_name*, *format_spec*, *conversion*). This is used by :meth:`vformat` to break the string into either literal text, or replacement fields.
trusted_official_docs
CPython Docs
.. method:: parse(format_string) Loop over the format_string and return an iterable of tuples (*literal_text*, *field_name*, *format_spec*, *conversion*). This is used by :meth:`vformat` to break the string into either literal text, or replacement fields.
.. method:: parse(format_string) Loop over the format_string and return an iterable of tuples (*literal_text*, *field_name*, *format_spec*, *conversion*). This is used by :meth:`vformat` to break the string into either literal text, or replacement fields.
python, official-docs, cpython, P0
Local_Trusted_Corpus
266b0566-e2be-4d5d-84ac-710204d025a4
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,954
supabase-export-v2
d0d59d7297dbf1cd
option is used. | | | | | | With no precision given, uses a precision of ``6`` | | | significant digits for :class:`float`. For | | | :class:`~decimal.Decimal`, the coefficient of the result | | | is formed from the coefficient digits of the value; | | | scientific notation is used for values smaller than | | | ``1...
trusted_official_docs
CPython Docs
option is used. | | | | | | With no precision given, uses a precision of ``6`` | | | significant digits for :class:`float`. For | | | :class:`~decimal.Decimal`, the coefficient of the result | | | is formed from the coefficient digits of the value; | | | scientific notation is used for values smaller than | | | ``1...
option is used. | | | | | | With no precision given, uses a precision of ``6`` | | | significant digits for :class:`float`. For | | | :class:`~decimal.Decimal`, the coefficient of the result | | | is formed from the coefficient digits of the value; | | | scientific notation is used for values smaller than | | | ``1...
python, official-docs, cpython, P0
Local_Trusted_Corpus
2a8a9bfd-77b9-49e7-91d3-28435bc96d73
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,896
supabase-export-v2
0a9f18d215677d71
.. versionchanged:: 3.1 The positional argument specifiers can be omitted for :meth:`str.format`, so ``'{} {}'.format(a, b)`` is equivalent to ``'{0} {1}'.format(a, b)``. .. versionchanged:: 3.4 The positional argument specifiers can be omitted for :class:`Formatter`.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.1 The positional argument specifiers can be omitted for :meth:`str.format`, so ``'{} {}'.format(a, b)`` is equivalent to ``'{0} {1}'.format(a, b)``. .. versionchanged:: 3.4 The positional argument specifiers can be omitted for :class:`Formatter`.
.. versionchanged:: 3.1 The positional argument specifiers can be omitted for :meth:`str.format`, so ``'{} {}'.format(a, b)`` is equivalent to ``'{0} {1}'.format(a, b)``. .. versionchanged:: 3.4 The positional argument specifiers can be omitted for :class:`Formatter`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
2ad6f271-45fb-4fb9-895e-b5be2b78a3de
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,998
supabase-export-v2
7a7a276159847050
* ``$$`` is an escape; it is replaced with a single ``$``. * ``$identifier`` names a substitution placeholder matching a mapping key of ``"identifier"``. By default, ``"identifier"`` is restricted to any case-insensitive ASCII alphanumeric string (including underscores) that starts with an underscore or ASCII letter...
trusted_official_docs
CPython Docs
* ``$$`` is an escape; it is replaced with a single ``$``. * ``$identifier`` names a substitution placeholder matching a mapping key of ``"identifier"``. By default, ``"identifier"`` is restricted to any case-insensitive ASCII alphanumeric string (including underscores) that starts with an underscore or ASCII letter...
* ``$$`` is an escape; it is replaced with a single ``$``. * ``$identifier`` names a substitution placeholder matching a mapping key of ``"identifier"``. By default, ``"identifier"`` is restricted to any case-insensitive ASCII alphanumeric string (including underscores) that starts with an underscore or ASCII letter...
python, official-docs, cpython, P0
Local_Trusted_Corpus
2be9fad1-8b68-4a15-9e9a-4d220fa9b074
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,980
supabase-export-v2
ca71e23fa7a269ee
Replacing ``%x`` and ``%o`` and converting the value to different bases:: >>> # format also supports binary numbers >>> "int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}".format(42) 'int: 42; hex: 2a; oct: 52; bin: 101010' >>> # with 0x, 0o, or 0b as prefix: >>> "int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".for...
trusted_official_docs
CPython Docs
Replacing ``%x`` and ``%o`` and converting the value to different bases:: >>> # format also supports binary numbers >>> "int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}".format(42) 'int: 42; hex: 2a; oct: 52; bin: 101010' >>> # with 0x, 0o, or 0b as prefix: >>> "int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".for...
Replacing ``%x`` and ``%o`` and converting the value to different bases:: >>> # format also supports binary numbers >>> "int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}".format(42) 'int: 42; hex: 2a; oct: 52; bin: 101010' >>> # with 0x, 0o, or 0b as prefix: >>> "int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".for...
python, official-docs, cpython, P0
Local_Trusted_Corpus
2dc17a05-5bdd-4247-906f-04bb75cf4610
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,879
supabase-export-v2
5560f4d11fc30bfe
.. method:: check_unused_args(used_args, args, kwargs) Implement checking for unused arguments if desired. The arguments to this function is the set of all argument keys that were actually referred to in the format string (integers for positional arguments, and strings for named arguments), and a reference to the *a...
trusted_official_docs
CPython Docs
.. method:: check_unused_args(used_args, args, kwargs) Implement checking for unused arguments if desired. The arguments to this function is the set of all argument keys that were actually referred to in the format string (integers for positional arguments, and strings for named arguments), and a reference to the *a...
.. method:: check_unused_args(used_args, args, kwargs) Implement checking for unused arguments if desired. The arguments to this function is the set of all argument keys that were actually referred to in the format string (integers for positional arguments, and strings for named arguments), and a reference to the *a...
python, official-docs, cpython, P0
Local_Trusted_Corpus
2fad2c3c-0c75-4269-aea4-bd58e66454c0
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,949
supabase-export-v2
be55752b351e1046
The available presentation types for :class:`float` and :class:`~decimal.Decimal` values are: +---------+----------------------------------------------------------+ | Type | Meaning | +=========+==========================================================+ | ``'e'`` | Scientific notation. For a given precision ``p``, ...
trusted_official_docs
CPython Docs
The available presentation types for :class:`float` and :class:`~decimal.Decimal` values are: +---------+----------------------------------------------------------+ | Type | Meaning | +=========+==========================================================+ | ``'e'`` | Scientific notation. For a given precision ``p``, ...
The available presentation types for :class:`float` and :class:`~decimal.Decimal` values are: +---------+----------------------------------------------------------+ | Type | Meaning | +=========+==========================================================+ | ``'e'`` | Scientific notation. For a given precision ``p``, ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
31a6d09a-8b12-4455-b8d0-5c590a1c7dc8
CPython Docs
file://datasets/cpython/Doc/library/string.rst
unknown
c08b4150-d3a9-400e-a929-bb83517af870
11,964
supabase-export-v2
4c8050e28c7ec5f0
to the old ``%``-formatting, with the addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``. The new format syntax also supports new and different options, shown in the following examples.
trusted_official_docs
CPython Docs
to the old ``%``-formatting, with the addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``. The new format syntax also supports new and different options, shown in the following examples.
to the old ``%``-formatting, with the addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``. The new format syntax also supports new and different options, shown in the following examples.
python, official-docs, cpython, P0
Local_Trusted_Corpus