8000 py39: fix mypyc complaint (#9552) · python/mypy@ab1bd98 · GitHub
[go: up one dir, main page]

Skip to content

Commit ab1bd98

Browse files
authored
py39: fix mypyc complaint (#9552)
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. Co-authored-by: hauntsaninja <>
1 parent 68797a6 commit ab1bd98

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mypy/fastparse.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,11 +1257,13 @@ def visit_Slice(self, n: ast3.Slice) -> SliceExpr:
12571257

12581258
# ExtSlice(slice* dims)
12591259
def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:
1260-
return TupleExpr(self.translate_expr_list(n.dims))
1260+
# cast for mypyc's benefit on Python 3.9
1261+
return TupleExpr(self.translate_expr_list(cast(Any, n.dims)))
12611262

12621263
# Index(expr value)
12631264
def visit_Index(self, n: Index) -> Node:
1264-
return self.visit(n.value)
1265+
# cast for mypyc's benefit on Python 3.9
1266+
return self.visit(cast(Any, n.value))
12651267

12661268

12671269
class TypeConverter:

0 commit comments

Comments
 (0)
0