refactor
Use when applying a named refactoring to Python code. Matches a code issue to a known transformation (nested conditionals to guard clauses or match, bare except to narrow exceptions, threads to asyncio, legacy TypeVar to PEP 695, mutable default arguments, dict soup to frozen dataclasses or pydantic models) and applies it as a surgical change. Includes the strangler facade for oversized modules.
Pinned to revision f4c79175a7cb, so it is the text this page describes rather than whatever the author pushed since.
Files
Every link opens the file at its source, pinned to the revision this page describes.