bpo-43224: Add tests for TypeVarTuple substitution in Annotated by mrahtz · Pull Request #31846 · python/cpython (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, but then how should we handle situations like this?

A = Annotated[Unpack[Ts], "foo"] B = A[int, str]

Annotated[int, str, "foo"] wouldn't be valid. We could do some kind of automatic tuple wrapping, Annotated[tuple[int, str], "foo", but that would be inconsistent with how we handle TypeVarTuple substitution elsewhere.