collections.OrderedDict
Maintains ordered key-value bindings and supports moving a key explicitly to either end.
CKTIS / Python
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Maintains ordered key-value bindings and supports moving a key explicitly to either end.
Provides an asynchronous context-manager base with a default entry method returning the manager itself.
Supplies the context-manager entry protocol and returns the manager itself by default.
Ensures that asynchronous cleanup is awaited when a managed resource leaves its scope.
Converts an asynchronous generator function into a factory for asynchronous context managers.
Collects cleanup actions dynamically and unwinds them in reverse registration order on asynchronous scope exit.
Adapts an object with a close method into a context manager that always closes it.
Allows a context manager to wrap the entire execution of a decorated function.
Builds a context-manager factory from a generator that yields the managed value exactly once.
Accumulates context managers and cleanup callbacks chosen at runtime and unwinds them on scope exit.
Supplies a no-operation context manager that optionally returns a provided value.
Temporarily routes writes to the Python standard error stream into a replacement stream.
Temporarily replaces the Python standard output stream so printed text can be captured.
Continues after a managed block when one of the specified exception types is raised.
Profiles a callable while returning its ordinary result and retaining per-function statistics.
Profiles trusted statement text in the main module namespace and optionally writes the collected statistics to a file.
Profiles trusted statement text with explicit global and local namespaces.
Groups delimiter, quoting and other CSV formatting parameters into a reusable dialect.
Reads rows into dictionaries using header fields as names by default.
Writes mapping values in the explicit field order supplied to the writer.
Parses delimited rows while honoring quoted fields and escaped quotes.
Infers likely CSV formatting from sample text and returns a dialect.
Serializes field sequences into delimited rows and quotes fields as needed.
Recursively converts a data-class instance into a dictionary of field names and values.