PEP 695 was accepted, and it looks like it will make it into Python 3.12. This PEP adds support for a new type parameter syntax for generic classes and methods. It also adds a new syntax for type aliases (both generic and not).
PEP 695 functionality is implemented in pyright today. It would be great to see it also implemented in mypy and the other major type checkers so we could start to use the new features in type stubs.
Here is a rough task list associated with this work:
PEP 695 was accepted, and it looks like it will make it into Python 3.12. This PEP adds support for a new type parameter syntax for generic classes and methods. It also adds a new syntax for type aliases (both generic and not).
PEP 695 functionality is implemented in pyright today. It would be great to see it also implemented in mypy and the other major type checkers so we could start to use the new features in type stubs.
Here is a rough task list associated with this work:
infer_variancekeyword parameter inTypeVar; see this section of PEP for detailstypestatement; see this section of PEP for detailstypestatement (including generic and recursive type definitions); see this section of PEP for detailsTypeAliasType, supported for backward compatibility; see this section of PEP for details