summaryrefslogtreecommitdiffstats
path: root/Parser/Python.asdl
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/Python.asdl')
-rw-r--r--Parser/Python.asdl11
1 files changed, 9 insertions, 2 deletions
diff --git a/Parser/Python.asdl b/Parser/Python.asdl
index e9423a7..cfc41ef 100644
--- a/Parser/Python.asdl
+++ b/Parser/Python.asdl
@@ -8,14 +8,15 @@ module Python
| Expression(expr body)
| FunctionType(expr* argtypes, expr returns)
- stmt = FunctionDef(identifier name, arguments args,
+ stmt = FunctionDef(identifier name, typeparam* typeparams, arguments args,
stmt* body, expr* decorator_list, expr? returns,
string? type_comment)
- | AsyncFunctionDef(identifier name, arguments args,
+ | AsyncFunctionDef(identifier name, typeparam* typeparams, arguments args,
stmt* body, expr* decorator_list, expr? returns,
string? type_comment)
| ClassDef(identifier name,
+ typeparam* typeparams,
expr* bases,
keyword* keywords,
stmt* body,
@@ -24,6 +25,7 @@ module Python
| Delete(expr* targets)
| Assign(expr* targets, expr value, string? type_comment)
+ | TypeAlias(expr name, typeparam* typeparams, expr value)
| AugAssign(expr target, operator op, expr value)
-- 'simple' indicates that we annotate simple name without parens
| AnnAssign(expr target, expr annotation, expr? value, int simple)
@@ -142,4 +144,9 @@ module Python
attributes (int lineno, int col_offset, int end_lineno, int end_col_offset)
type_ignore = TypeIgnore(int lineno, string tag)
+
+ typeparam = TypeVar(identifier name, expr? bound)
+ | ParamSpec(identifier name)
+ | TypeVarTuple(identifier name)
+ attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)
}