[syntax-errors] Type parameter defaults before Python 3.13 (#16447)

Summary
--

Detects the presence of a [PEP 696] type parameter default before Python
3.13.

Test Plan
--

New inline parser tests for type aliases, generic functions and generic
classes.

[PEP 696]: https://peps.python.org/pep-0696/#grammar-changes
This commit is contained in:
Brent Westbrook 2025-03-04 11:53:38 -05:00 committed by GitHub
parent c8a06a9be8
commit e7b93f93ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 514 additions and 4 deletions

View file

@ -0,0 +1,5 @@
# parse_options: {"target-version": "3.12"}
type X[T = int] = int
def f[T = int](): ...
class C[T = int](): ...
class D[S, T = int, U = uint](): ...

View file

@ -0,0 +1,4 @@
# parse_options: {"target-version": "3.13"}
type X[T = int] = int
def f[T = int](): ...
class C[T = int](): ...