Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions mypy/fastparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
Loading