示例#1
0
 def convert_unary_op(self, context, expr, op):
     return context.pushTerminal(
         generateThrowException(
             context,
             TypeError("Can't apply unary op %s to type '%s'" %
                       (op, expr.expr_type))))
示例#2
0
 def convert_len(self, context, expr):
     return context.pushTerminal(
         generateThrowException(
             context,
             TypeError("Can't take 'len' of instance of type '%s'" %
                       (str(self), ))))
 def convert_getitem(self, context, instance, item):
     return context.pushTerminal(
         generateThrowException(
             context,
             AttributeError("%s is not subscriptable" % str(self))))
 def convert_setitem(self, context, instance, index, value):
     return context.pushTerminal(
         generateThrowException(
             context,
             AttributeError("%s does not support item assignment" %
                            str(self))))
 def convert_set_attribute(self, context, instance, attribute, value):
     return context.pushTerminal(
         generateThrowException(
             context,
             AttributeError("%s object has no attribute %s" %
                            (self, attribute))))