Community consensus on PEP 695

Last year, PEP 695 was posted to the PEPs category (PEP 695: Type Parameter Syntax). There was very little discussion there (although there had been a bit of discussion on typing-sig@ before then). The PEP was subsequently submitted to the Steering Council for consideration.

The relative silence around the proposal surprises me a little (and I know I’m not the only one), and I’m trying to figure out if this means there’s consensus that this is a reasonable extension of Python syntax despite the fact that it only benefits type annotations, or that it just escaped people’s attention. In case it’s the second, let me point out the proposed syntax, and you should read the full PEP and the discussion linked above if you want to know more:

class ClassA[T: str]:
    def method1(self) -> T:
        ...

… and …

def func[T](a: T, b: T) -> T:
    ...

… and …

type ListOrSet[T] = list[T] | set[T]

Now, it’s perfectly reasonable not to have an opinion on this, or to not consider it a big deal either way – but if you do have an opinion, please let us know by either contributing to the discussion above, or contacting the SC (or one of the SC members) directly.

6 Likes

Per @thomas 's request above: