Python

Notes on the Python programming language — testing, async, type hints, and practical patterns.

Why 'NoReturn' type exists in Python

Use Python's NoReturn type to annotate functions that never return normally, helping type checkers understand exception-raising and infinite loop code.

Amphibian decorators in Python

Build Python decorators that work seamlessly with both sync and async functions using inspect.iscoroutinefunction for maximum flexibility.

Static typing Python decorators

Type Python decorators accurately using ParamSpec and Concatenate to preserve wrapped function signatures and enable proper static analysis.

Inspect docstrings with Pydoc

View Python docstrings from the command line with pydoc or serve them as HTML documentation for modules, classes, and functions.