Skip to content

py39: fix mypyc complaint #9552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2020
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
6 changes: 4 additions & 2 deletions mypy/fastparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,11 +1257,13 @@ def visit_Slice(self, n: ast3.Slice) -> SliceExpr:

# ExtSlice(slice* dims)
def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:
return TupleExpr(self.translate_expr_list(n.dims))
# 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:
return self.visit(n.value)
# cast for mypyc's benefit on Python 3.9
return self.visit(cast(Any, n.value))


class TypeConverter:
Expand Down