diff --git a/python/extractor/tests/parser/types_new.expected b/python/extractor/tests/parser/types_new.expected index be42268c201ae..f4e782ede51f6 100644 --- a/python/extractor/tests/parser/types_new.expected +++ b/python/extractor/tests/parser/types_new.expected @@ -1,4 +1,4 @@ -Module: [1, 0] - [6, 0] +Module: [1, 0] - [23, 0] body: [ TypeAlias: [1, 0] - [1, 34] name: @@ -12,6 +12,7 @@ Module: [1, 0] - [6, 0] variable: Variable('T1', None) ctx: Store bound: None + default: None TypeVar: [1, 11] - [1, 17] name: Name: [1, 11] - [1, 13] @@ -21,16 +22,19 @@ Module: [1, 0] - [6, 0] Name: [1, 15] - [1, 17] variable: Variable('E1', None) ctx: Load + default: None TypeVarTuple: [1, 19] - [1, 22] name: Name: [1, 20] - [1, 22] variable: Variable('T3', None) ctx: Store + default: None ParamSpec: [1, 24] - [1, 28] name: Name: [1, 26] - [1, 28] variable: Variable('T4', None) ctx: Store + default: None ] value: Name: [1, 32] - [1, 34] @@ -64,6 +68,7 @@ Module: [1, 0] - [6, 0] variable: Variable('T6', None) ctx: Store bound: None + default: None TypeVar: [3, 10] - [3, 16] name: Name: [3, 10] - [3, 12] @@ -73,16 +78,19 @@ Module: [1, 0] - [6, 0] Name: [3, 14] - [3, 16] variable: Variable('E2', None) ctx: Load + default: None TypeVarTuple: [3, 18] - [3, 21] name: Name: [3, 19] - [3, 21] variable: Variable('T8', None) ctx: Store + default: None ParamSpec: [3, 23] - [3, 27] name: Name: [3, 25] - [3, 27] variable: Variable('T9', None) ctx: Store + default: None ] args: [] vararg: None @@ -109,6 +117,7 @@ Module: [1, 0] - [6, 0] variable: Variable('T10', None) ctx: Store bound: None + default: None TypeVar: [5, 13] - [5, 20] name: Name: [5, 13] - [5, 16] @@ -118,16 +127,19 @@ Module: [1, 0] - [6, 0] Name: [5, 18] - [5, 20] variable: Variable('E3', None) ctx: Load + default: None TypeVarTuple: [5, 22] - [5, 26] name: Name: [5, 23] - [5, 26] variable: Variable('T12', None) ctx: Store + default: None ParamSpec: [5, 28] - [5, 33] name: Name: [5, 30] - [5, 33] variable: Variable('T13', None) ctx: Store + default: None ] bases: [] keywords: [] @@ -139,4 +151,284 @@ Module: [1, 0] - [6, 0] value: Ellipsis: [5, 36] - [5, 39] ] + Assign: [10, 0] - [10, 21] + targets: [ + Name: [10, 6] - [10, 9] + variable: Variable('Foo', None) + ctx: Store + ] + value: + ClassExpr: [10, 0] - [10, 21] + name: 'Foo' + type_parameters: [ + TypeVar: [10, 10] - [10, 19] + name: + Name: [10, 10] - [10, 13] + variable: Variable('T14', None) + ctx: Store + bound: None + default: + Name: [10, 16] - [10, 19] + variable: Variable('str', None) + ctx: Load + ] + bases: [] + keywords: [] + inner_scope: + Class: [10, 0] - [10, 21] + name: 'Foo' + body: [ + Expr: [10, 22] - [10, 25] + value: + Ellipsis: [10, 22] - [10, 25] + ] + Assign: [13, 0] - [13, 29] + targets: [ + Name: [13, 6] - [13, 9] + variable: Variable('Baz', None) + ctx: Store + ] + value: + ClassExpr: [13, 0] - [13, 29] + name: 'Baz' + type_parameters: [ + ParamSpec: [13, 10] - [13, 27] + name: + Name: [13, 12] - [13, 14] + variable: Variable('P1', None) + ctx: Store + default: + List: [13, 17] - [13, 27] + elts: [ + Name: [13, 18] - [13, 21] + variable: Variable('int', None) + ctx: Load + Name: [13, 23] - [13, 26] + variable: Variable('str', None) + ctx: Load + ] + ctx: Load + ] + bases: [] + keywords: [] + inner_scope: + Class: [13, 0] - [13, 29] + name: 'Baz' + body: [ + Expr: [13, 30] - [13, 33] + value: + Ellipsis: [13, 30] - [13, 33] + ] + Assign: [16, 0] - [16, 36] + targets: [ + Name: [16, 6] - [16, 9] + variable: Variable('Qux', None) + ctx: Store + ] + value: + ClassExpr: [16, 0] - [16, 36] + name: 'Qux' + type_parameters: [ + TypeVarTuple: [16, 10] - [16, 34] + name: + Name: [16, 11] - [16, 14] + variable: Variable('Ts1', None) + ctx: Store + default: + Starred: [16, 17] - [16, 34] + value: + Subscript: [16, 18] - [16, 34] + value: + Name: [16, 18] - [16, 23] + variable: Variable('tuple', None) + ctx: Load + index: + Tuple: [16, 24] - [16, 33] + elts: [ + Name: [16, 24] - [16, 27] + variable: Variable('int', None) + ctx: Load + Name: [16, 29] - [16, 33] + variable: Variable('bool', None) + ctx: Load + ] + ctx: Load + ctx: Load + ctx: Load + ] + bases: [] + keywords: [] + inner_scope: + Class: [16, 0] - [16, 36] + name: 'Qux' + body: [ + Expr: [16, 37] - [16, 40] + value: + Ellipsis: [16, 37] - [16, 40] + ] + TypeAlias: [19, 0] - [19, 36] + name: + Name: [19, 5] - [19, 8] + variable: Variable('Foo', None) + ctx: Store + type_parameters: [ + TypeVar: [19, 9] - [19, 12] + name: + Name: [19, 9] - [19, 12] + variable: Variable('T15', None) + ctx: Store + bound: None + default: None + TypeVar: [19, 14] - [19, 21] + name: + Name: [19, 14] - [19, 15] + variable: Variable('U', None) + ctx: Store + bound: None + default: + Name: [19, 18] - [19, 21] + variable: Variable('str', None) + ctx: Load + ] + value: + Subscript: [19, 25] - [19, 36] + value: + Name: [19, 25] - [19, 28] + variable: Variable('Bar', None) + ctx: Load + index: + Tuple: [19, 29] - [19, 35] + elts: [ + Name: [19, 29] - [19, 32] + variable: Variable('T15', None) + ctx: Load + Name: [19, 34] - [19, 35] + variable: Variable('U', None) + ctx: Load + ] + ctx: Load + ctx: Load + TypeAlias: [20, 0] - [20, 40] + name: + Name: [20, 5] - [20, 8] + variable: Variable('Baz', None) + ctx: Store + type_parameters: [ + ParamSpec: [20, 9] - [20, 26] + name: + Name: [20, 11] - [20, 13] + variable: Variable('P2', None) + ctx: Store + default: + List: [20, 16] - [20, 26] + elts: [ + Name: [20, 17] - [20, 20] + variable: Variable('int', None) + ctx: Load + Name: [20, 22] - [20, 25] + variable: Variable('str', None) + ctx: Load + ] + ctx: Load + ] + value: + Subscript: [20, 30] - [20, 40] + value: + Name: [20, 30] - [20, 34] + variable: Variable('Spam', None) + ctx: Load + index: + BinOp: [20, 35] - [20, 39] + left: + Name: [20, 35] - [20, 35] + variable: Variable('', None) + ctx: Load + op: Pow + right: + Name: [20, 37] - [20, 39] + variable: Variable('P2', None) + ctx: Load + ctx: Load + TypeAlias: [21, 0] - [21, 40] + name: + Name: [21, 5] - [21, 8] + variable: Variable('Qux', None) + ctx: Store + type_parameters: [ + TypeVarTuple: [21, 9] - [21, 27] + name: + Name: [21, 10] - [21, 13] + variable: Variable('Ts2', None) + ctx: Store + default: + Starred: [21, 16] - [21, 27] + value: + Subscript: [21, 17] - [21, 27] + value: + Name: [21, 17] - [21, 22] + variable: Variable('tuple', None) + ctx: Load + index: + Name: [21, 23] - [21, 26] + variable: Variable('str', None) + ctx: Load + ctx: Load + ctx: Load + ] + value: + Subscript: [21, 31] - [21, 40] + value: + Name: [21, 31] - [21, 34] + variable: Variable('Ham', None) + ctx: Load + index: + Starred: [21, 35] - [21, 39] + value: + Name: [21, 36] - [21, 39] + variable: Variable('Ts2', None) + ctx: Load + ctx: Load + ctx: Load + TypeAlias: [22, 0] - [22, 36] + name: + Name: [22, 5] - [22, 8] + variable: Variable('Rab', None) + ctx: Store + type_parameters: [ + TypeVar: [22, 9] - [22, 10] + name: + Name: [22, 9] - [22, 10] + variable: Variable('U', None) + ctx: Store + bound: None + default: None + TypeVar: [22, 12] - [22, 21] + name: + Name: [22, 12] - [22, 15] + variable: Variable('T15', None) + ctx: Store + bound: None + default: + Name: [22, 18] - [22, 21] + variable: Variable('str', None) + ctx: Load + ] + value: + Subscript: [22, 25] - [22, 36] + value: + Name: [22, 25] - [22, 28] + variable: Variable('Bar', None) + ctx: Load + index: + Tuple: [22, 29] - [22, 35] + elts: [ + Name: [22, 29] - [22, 32] + variable: Variable('T15', None) + ctx: Load + Name: [22, 34] - [22, 35] + variable: Variable('U', None) + ctx: Load + ] + ctx: Load + ctx: Load ]