Skip to content

Commit

Permalink
py39: fix mypyc complaint
Browse files Browse the repository at this point in the history
I was trying to build wheels for Python 3.9 as part of python#9536, but ran
into this issue. You'll notice a couple hundred lines up msullivan
points out that mypyc can't handle conditional method definition, so
that's not an option here.
  • Loading branch information
hauntsaninja committed Oct 8, 2020
1 parent 3978297 commit aabf4ce
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit aabf4ce

Please sign in to comment.