From acd603496237a78b109ca9d89991539633cbbb99 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Wed, 7 Oct 2020 22:07:02 -0700 Subject: [PATCH] py39: fix mypyc complaint I was trying to build wheels for Python 3.9 as part of #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. --- mypy/fastparse.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mypy/fastparse.py b/mypy/fastparse.py index 2dafbf4e1454..0b72214100d8 100644 --- a/mypy/fastparse.py +++ b/mypy/fastparse.py @@ -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: