facebookincubator / cinder

Cinder is Meta's internal performance-oriented production version of CPython.
https://trycinder.com
Other
3.49k stars 121 forks source link

Static Python: primitive types don't support pow operator #25

Open belm0 opened 3 years ago

belm0 commented 3 years ago

(and there is an exception while assembling the error message)

def test(x: double, y: double) -> double:
    return x ** y
  File "/usr/lib/python3.8/compiler/visitor.py", line 70, in visit
    return meth(node, *args)
  File "/usr/lib/python3.8/compiler/static.py", line 5995, in visitBinOp
    if ltype.bind_binop(node, self, type_ctx):
  File "/usr/lib/python3.8/compiler/static.py", line 4866, in bind_binop
    raise visitor.syntax_error(self.binop_error(self, rtype, node.op), node)
  File "/usr/lib/python3.8/compiler/static.py", line 4398, in binop_error
    return f"cannot {self._op_name[type(op)]} {left.name} and {right.name}"
KeyError: <class '_ast.Pow'>