parent
abe57e3d92
commit
722735d20e
@ -37,6 +37,9 @@
|
||||
|
||||
<!-- Changes to the parser or to version autodetection -->
|
||||
|
||||
- Add support for PEP 695 type aliases containing lambdas and other unusual expressions
|
||||
(#3949)
|
||||
|
||||
### Performance
|
||||
|
||||
<!-- Changes that improve Black's performance. -->
|
||||
|
@ -108,7 +108,7 @@ dotted_as_names: dotted_as_name (',' dotted_as_name)*
|
||||
dotted_name: NAME ('.' NAME)*
|
||||
global_stmt: ('global' | 'nonlocal') NAME (',' NAME)*
|
||||
assert_stmt: 'assert' test [',' test]
|
||||
type_stmt: "type" NAME [typeparams] '=' expr
|
||||
type_stmt: "type" NAME [typeparams] '=' test
|
||||
|
||||
compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt | match_stmt
|
||||
async_stmt: ASYNC (funcdef | with_stmt | for_stmt)
|
||||
|
@ -1,6 +1,10 @@
|
||||
# flags: --minimum-version=3.12
|
||||
|
||||
type A=int
|
||||
type Gen[T]=list[T]
|
||||
type Alias[T]=lambda: T
|
||||
type And[T]=T and T
|
||||
type IfElse[T]=T if T else T
|
||||
|
||||
type = aliased
|
||||
print(type(42))
|
||||
@ -9,6 +13,9 @@
|
||||
|
||||
type A = int
|
||||
type Gen[T] = list[T]
|
||||
type Alias[T] = lambda: T
|
||||
type And[T] = T and T
|
||||
type IfElse[T] = T if T else T
|
||||
|
||||
type = aliased
|
||||
print(type(42))
|
||||
|
Loading…
Reference in New Issue
Block a user