FTW Patch

fitzzftw.patch

This package provides high-level patching and introspection utilities for Python Protocols and callables. It dynamically adapts to the Python runtime to ensure consistent metadata extraction across versions.

Architecture:

The package uses a version-dispatching mechanism to handle significant changes in Python’s introspection capabilities:

  • Python 3.14+: Leverages PEP 649 (Deferred Evaluation) and ‘annotationlib’.

  • Python 3.12 - 3.13: Uses standard ‘inspect’ and ‘typing’ hints.

  • Python 3.11: Implements legacy workarounds for Protocol introspection.

Exported API:

The following classes are resolved dynamically based on sys.version_info:

Note:

Documentation is primarily linked to the current_312_313 implementation to provide a stable reference, though all versions adhere to the same public interface.

fitzzftw.patch.base

base

fitzzftw.patch.protocols

Structural Protocols and Type Hints

fitzzftw.patch.parser

Unified Diff and Patch Parsing

fitzzftw.patch.patcher

Patch Application Engine

fitzzftw.patch.container

container

fitzzftw.patch.exceptions

exceptions

fitzzftw.patch.ftw_patch

FTW Patch

fitzzftw.patch.lines

lines

fitzzftw.patch.static

static

fitzzftw.patch.utils

General Utilities and Configuration Handling

fitzzftw.patch.legacy_311

legacy_311

fitzzftw.patch.current_312_313

Version-Specific Protocol Introspection (Python 3.12 - 3.13)

fitzzftw.patch.future_314_ge

Modern Protocol Introspection (Python 3.14+)