Example #1
0
 def NotSupportedOperand(klass, op, left, right=None):
   if right:
     if klass.is_ignored(left) or klass.is_ignored(right): return None
     return TypeErrorType.occur('not supported operand %s(%s, %s)' %
                                (op, left.get_type().typename(), right.get_type().typename()))
   else:
     if klass.is_ignored(left): return None
     return TypeErrorType.occur('not supported operand %s(%s)' % (op, left.get_type().typename()))
Example #2
0
 def NoLength(klass, obj):
   if klass.is_ignored(obj): return None
   return TypeErrorType.occur('length not defined: %s' % obj)
Example #3
0
 def NotAssignable(klass, obj):
   if klass.is_ignored(obj): return None
   return TypeErrorType.occur('cannot assign item: %s' % obj)
Example #4
0
 def NotSubscriptable(klass, obj):
   if klass.is_ignored(obj): return None
   return TypeErrorType.occur('not subscriptable: %s' % obj)
Example #5
0
 def NotIterable(klass, obj):
   if klass.is_ignored(obj): return None
   return TypeErrorType.occur('not iterable: %s' % obj)
Example #6
0
 def InvalidNumOfArgs(klass, valid, nargs):
   if valid < nargs:
     return TypeErrorType.occur('too many args: %r required, %r given' % (valid, nargs))
   else:
     return TypeErrorType.occur('too few args: %r given, %r required' % (nargs, valid))
Example #7
0
 def InvalidKeywordArgs(klass, kwd):
   return TypeErrorType.occur('invalid keyword argument: %s' % kwd)
Example #8
0
 def NoKeywordArg1(klass, kwd):
   return TypeErrorType.occur('cannot take keyword: %s' % kwd)
Example #9
0
 def NoKeywordArgs(klass):
   return TypeErrorType.occur('cannot take a keyword argument')
Example #10
0
 def NotInstantiatable(klass, typename):
   return TypeErrorType.occur('not instantiatable: %s' % typename)
Example #11
0
 def TypeCheckerError(klass, src, obj, validtype):
   return TypeErrorType.occur('%s (%s) must be %s' % (src, obj, validtype))