From 9338654da4a9275e258e241ce0f519d1c9912b91 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 27 Aug 2025 01:22:22 +0200 Subject: [PATCH] Cleanup old ast classes in fastparse --- mypy/fastparse.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index 99d5c48c92d7..6b2eb532003c 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -129,9 +129,7 @@ PY_MINOR_VERSION: Final = sys.version_info[1] import ast as ast3 - -# TODO: Index, ExtSlice are deprecated in 3.9. -from ast import AST, Attribute, Call, FunctionType, Index, Name, Starred, UAdd, UnaryOp, USub +from ast import AST, Attribute, Call, FunctionType, Name, Starred, UAdd, UnaryOp, USub def ast3_parse( @@ -1779,18 +1777,6 @@ def visit_Slice(self, n: ast3.Slice) -> SliceExpr: e = SliceExpr(self.visit(n.lower), self.visit(n.upper), self.visit(n.step)) return self.set_line(e, n) - # ExtSlice(slice* dims) - def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr: - # cast for mypyc's benefit on Python 3.9 - return TupleExpr(self.translate_expr_list(cast(Any, n).dims)) - - # Index(expr value) - def visit_Index(self, n: Index) -> Node: - # cast for mypyc's benefit on Python 3.9 - value = self.visit(cast(Any, n).value) - assert isinstance(value, Node) - return value - # Match(expr subject, match_case* cases) # python 3.10 and later def visit_Match(self, n: Match) -> MatchStmt: node = MatchStmt(