Static Python: primitive types don't support pow operator

Open
#25 0 comments 0 reactions 1 assignee View on GitHub

@sinancepel is already working on this.

Since Dec 22, 2021.

Assessment

This issue has not been assessed yet.

Description

sp-correctness staticpython

(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'>
Dominant language
Python
Stars
3.8k
Forks
139
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebookincubator/MetaPython

All issues in facebookincubator/MetaPython

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.