def power(self, *args):
if not len(args) > 1:
raise EvaluateException('** requires at least 2 parameters!' + ' (' + str(len(args)) + ' given).')
elif False in [isinstance(x, NumberType) for x in args]:
raise EvaluateException('** requires all parameters to be numbers!')
return reduce(op.pow, args[1:], args[0])
评论列表
文章目录