# 02 · generic-preserves-type **演示**:`first(items: Sequence[T]) -> T` 在检查器眼里保留元素类型;`Any` 版本不保留。运行时泛型被擦除:`Box[int]` 的实例 `type()` 仍是 `Box`,只有显式下标实例化才留下 `__orig_class__`。 **运行**: ```sh uv run python examples/11-protocols-generics-overloads/02-generic-preserves-type/generic_preserves_type.py ``` **预期输出**(3.12.9): ```text first: 10 first type: int any: 10 generic repr: __main__.Box[int] instance class: Box orig class: __main__.Box[int] plain has orig: False ``` **依赖**:仅标准库。 **注意**:`Box(7)` 不写类型参数,因此没有 `__orig_class__`;`Box[int](42)` 才有。`__orig_class__` 是运行时元数据,不是类型检查依据。