Power operation was not implemented before.

This commit is contained in:
Dave Halter
2015-11-20 18:26:39 +01:00
parent 030131d705
commit 8d65129a19
2 changed files with 11 additions and 1 deletions

View File

@@ -273,7 +273,9 @@ class Evaluator(object):
types = self._eval_atom(element.children[0])
for trailer in element.children[1:]:
if trailer == '**': # has a power operation.
raise NotImplementedError
right = self.eval_element(element.children[2])
types = set(precedence.calculate(self, types, trailer, right))
break
types = self.eval_trailer(types, trailer)
elif element.type in ('testlist_star_expr', 'testlist',):
# The implicit tuple in statements.

View File

@@ -48,6 +48,14 @@ a = 3 * "a"
#? str()
a
a = 3 * "a"
#? str()
a
#? int()
(3 ** 3)
#? int() str()
(3 ** 'a')
# -----------------
# assignments