PEP 695: Type Parameter Syntax

Yes, it’s too late.

It doesn’t conflict in the grammar, because PEP 695 syntax doesn’t appear in places where you could use a slice. I can’t say if some people might find it confusing, but something like this:

def f[T: int](x: list[T]) -> list[T]:
    return x[:1:2]

the two uses of : within square brackets are visually quite different.

2 Likes