Permalink
Browse files

Support Pow nodes ("x**2")

  • Loading branch information...
1 parent 0b17e3c commit 1d1a67f3fd6f220b1cb07f6c607f691782b0dc22 @andrewschaaf committed Feb 5, 2014
Showing with 5 additions and 0 deletions.
  1. +1 −0 codegen.py
  2. +4 −0 test/test_codegen.py
View
@@ -26,6 +26,7 @@
Div: '/',
FloorDiv: '//',
Mod: '%',
+ Pow: '**',
LShift: '<<',
RShift: '>>',
BitOr: '|',
@@ -4,6 +4,10 @@
def to_ast_and_back_again(source):
return codegen.to_source(ast.parse(source))
+def test_Pow():
+ source = "y = (x ** 2)\n"
+ assert source == to_ast_and_back_again(source)
+
def test_del():
source = "del l[0]"
assert source == to_ast_and_back_again(source)

0 comments on commit 1d1a67f

Please sign in to comment.