Skip to content

Commit 0d786b4

Browse files
committed
add test file for new 3.12 syntax
1 parent 7312cbd commit 0d786b4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

testsuite/python312.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,23 @@ def foo():
77

88
def bar():
99
pass
10+
#: Okay
11+
# new type aliases
12+
type X = int | str
13+
type Y[T] = list[T]
14+
type Z[T: str] = list[T]
15+
#: Okay
16+
# new generics
17+
def f[T](x: T) -> T:
18+
pass
19+
20+
21+
def g[T: str, U: int](x: T, y: U) -> dict[T, U]:
22+
pass
23+
#: Okay
24+
# new nested f-strings
25+
f'{
26+
thing
27+
} {f'{other} {thing}'}'
28+
#: E201:1:4 E202:1:17
29+
f'{ an_error_now }'

0 commit comments

Comments
 (0)