--- /home/docs/checkouts/readthedocs.org/user_builds/restrictedpython/checkouts/latest/docs/contributing/ast/python3_11.ast
+++ /home/docs/checkouts/readthedocs.org/user_builds/restrictedpython/checkouts/latest/docs/contributing/ast/python3_12.ast
@@ -1,8 +1,8 @@
--- Python 3.11 AST
+-- Python 3.12 AST
-- ASDL's 4 builtin types are:
-- identifier, int, string, constant
-module Python version "3.11"
+module Python version "3.12"
{
mod = Module(stmt* body, type_ignore* type_ignores)
| Interactive(stmt* body)
@@ -14,23 +14,27 @@
stmt* body,
expr* decorator_list,
expr? returns,
- string? type_comment)
+ string? type_comment,
+ type_param* type_params)
| AsyncFunctionDef(identifier name,
arguments args,
stmt* body,
expr* decorator_list,
expr? returns,
- string? type_comment)
+ string? type_comment,
+ type_param* type_params)
| ClassDef(identifier name,
expr* bases,
keyword* keywords,
stmt* body,
- expr* decorator_list)
+ expr* decorator_list,
+ type_param* type_params)
| Return(expr? value)
| Delete(expr* targets)
| Assign(expr* targets, expr value, string? type_comment)
+ | TypeAlias(expr name, type_param* type_params, 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)
@@ -182,4 +186,9 @@
attributes (int lineno, int col_offset, int end_lineno, int end_col_offset)
type_ignore = TypeIgnore(int lineno, string tag)
+
+ type_param = TypeVar(identifier name, expr? bound)
+ | ParamSpec(identifier name)
+ | TypeVarTuple(identifier name)
+ attributes (int lineno, int col_offset, int end_lineno, int end_col_offset)
}