mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:39:12 +00:00
[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:
parent
c8a06a9be8
commit
e7b93f93ef
6 changed files with 514 additions and 4 deletions
|
@ -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](): ...
|
|
@ -0,0 +1,4 @@
|
|||
# parse_options: {"target-version": "3.13"}
|
||||
type X[T = int] = int
|
||||
def f[T = int](): ...
|
||||
class C[T = int](): ...
|
Loading…
Add table
Add a link
Reference in a new issue