用 Protocol 与类型收窄设计可替换的 Python 边界 Dec 6, 2025 用 Python 3.12/3.13 的结构化子类型、TypeGuard 与 TypeIs 为依赖边界提供静态反馈,同时保留运行时验证。