Keyword try
Protect a suite with matching exception handlers or attach unconditional cleanup with finally.
CKTIS / Python
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Protect a suite with matching exception handlers or attach unconditional cleanup with finally.
Test the condition before each iteration, including the first.
Enter the context manager and optionally bind the value returned by `__enter__`.
In an ordinary function, yield makes calling it create a generator rather than execute the body immediately.
The abc module lets you define abstract base classes and mark methods as abstract.
Coordinate asynchronous I/O with an event loop, coroutines and tasks.
Provides specialized containers including Counter, deque and defaultdict.
Build and compose context managers for scoped resources.
Profile a workload by recording call events, counts and elapsed times.
Parse and write delimited text using dialect rules for separators and quoting.
Generate field-based initialization, representation and equality from a class declaration.
Represent dates, times, combined timestamps and durations.
The decimal module provides Decimal for decimal calculations with explicit precision and rounding control, useful for monetary amounts and similar data.
Transform callables with tools for partial application, wrapping and memoization.
Maintain a binary heap in a list for priority-queue operations.
Provides raw, buffered binary and decoded text streams, including in-memory buffers.
Compose iterators for lazy transformations, grouping and combinatorics.
Route severity-tagged records from named loggers through handlers and formatters.
Provides real-number mathematics, including floating-point functions, constants and exact integer operations.
The pstats module analyzes data from cProfile or profile: it sorts function statistics and produces reports that help locate expensive parts of a program.
Compile regular expressions to search, match, extract or replace text.
The sys module exposes interpreter parameters, program arguments, standard streams, and a function that signals program termination.
Benchmark a small statement or callable in repeated batches.
Express static relationships using annotations, unions, generics and protocols, and inspect them at runtime.