Skip to content

Commit

Permalink
Merge pull request #497 from python-rope/lieryan-496-matmul-op
Browse files Browse the repository at this point in the history
Add MatMul operator to patchedast
  • Loading branch information
lieryan committed Jul 18, 2022
2 parents 79f2efe + 30cda85 commit 51b1bf8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# **Upcoming release**

## Bug fixes

- #496,#497 Add MatMul operator to patchedast

# Release 1.2.0

Date: 2022-04-22
Expand Down
1 change: 1 addition & 0 deletions rope/refactor/patchedast.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def _child_nodes(self, nodes, separator):
"Div": "/",
"Mod": "%",
"Pow": "**",
"MatMult": "@",
"LShift": "<<",
"RShift": ">>",
"BitOr": "|",
Expand Down
6 changes: 6 additions & 0 deletions ropetest/refactor/patchedasttest.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ def test_and_node(self):
checker.check_region("BoolOp", 0, len(source) - 1)
checker.check_children("BoolOp", [NameConstant, " ", "and", " ", NameConstant])

def test_matmult_node(self):
source = "a @ b\n"
ast_frag = patchedast.get_patched_ast(source, True)
checker = _ResultChecker(self, ast_frag)
checker.check_children("BinOp", ["Name", " ", "@", " ", "Name"])

def test_basic_closing_parens(self):
source = "1 + (2)\n"
ast_frag = patchedast.get_patched_ast(source, True)
Expand Down

0 comments on commit 51b1bf8

Please sign in to comment.