Skip to content

Commit 1ced5b4

Browse files
committed
Python: Add test for type parameter defaults
1 parent 24d98ee commit 1ced5b4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

python/extractor/tests/parser/types_new.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,20 @@
33
def f[T6, T7: E2, *T8, **T9](): ...
44

55
class C[T10, T11: E3, *T12, **T13]: ...
6+
7+
# From PEP-696 (https://peps.python.org/pep-0696/#grammar-changes):
8+
9+
# TypeVars
10+
class Foo1[T14 = str]: ...
11+
12+
# ParamSpecs
13+
class Baz1[**P1 = [int, str]]: ...
14+
15+
# TypeVarTuples
16+
class Qux1[*Ts1 = *tuple[int, bool]]: ...
17+
18+
# TypeAliases
19+
type Foo2[T15, U1 = str] = Bar1[T15, U1]
20+
type Baz2[**P2 = [int, str]] = Spam[**P2]
21+
type Qux2[*Ts2 = *tuple[str]] = Ham[*Ts2]
22+
type Rab[U2, T15 = str] = Bar2[T15, U2]

0 commit comments

Comments
 (0)