Commits

Anonymous committed 70e9b2f

Raise NotImplementedError for unimplemented builtin funcs, rather than return null

  • Participants
  • Parent commits b23c03a

Comments (0)

Files changed (1)

File src/builtins/funcs.pir

 =cut
 
 .sub 'basestring'
-    print 'basestring() not implemented'
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
-
 =item bool([x])
 
 Convert a value to a Boolean, using the standard truth testing procedure.
 
 .sub 'classmethod'
     .param pmc function
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
     .param pmc kind
     .param pmc flags :optional
     .param pmc dont_inherit :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item complex([real[, imag]])
 .sub 'complex'
     .param pmc real :optional
     .param pmc imag :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 .sub 'delattr'
     .param pmc obj
     .param pmc name
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 .sub 'dict'
     .param pmc sequence :optional
     .param pmc mapping :slurpy :named :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'dir'
     .param pmc obj :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item divmod(a, b)
 .sub 'divmod'
     .param pmc a
     .param pmc b
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'enumerate'
     .param pmc iterable
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
     .param pmc expr
     .param pmc globals :optional
     .param pmc locals  :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item execfile(filename[, globals[, locals]])
     .param pmc filename
     .param pmc globals :optional
     .param pmc locals  :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
     .param pmc filename
     .param pmc mode    :optional
     .param pmc bufsize :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 .sub 'filter'
     .param pmc function
     .param pmc list
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'float'
     .param pmc x :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'frozenset'
     .param pmc iterable :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
     .param pmc obj
     .param pmc name
     .param pmc default :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item globals()
 =cut
 
 .sub 'globals'
-
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item hasattr(object, name)
 .sub 'hasattr'
     .param pmc obj
     .param pmc name
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'hash'
     .param pmc obj
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'help'
     .param pmc obj :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item hex(x)
 
 .sub 'hex'
     .param pmc x
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'id'
     .param pmc obj
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'input'
     .param pmc prompt :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 .sub 'int'
     .param pmc x :optional
     .param pmc radix :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 .sub 'issubclass'
     .param pmc class
     .param pmc classinfo
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 .sub 'iter'
     .param pmc o
     .param pmc sentinel :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item len(s)
 =cut
 
 .sub 'locals'
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item long([x[, radix]])
 .sub 'long'
     .param pmc x     :optional
     .param pmc radix :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item map(function, list, ...)
     .param pmc function
     .param pmc list
     .param pmc args :slurpy
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 .sub 'max'
     .param pmc s
     .param pmc args :slurpy
-	#.param pmc key :named :optional
+	#.param pmc key :named :optional        XXX
 
 	.local pmc iter, result
 	
 .sub 'min'
     .param pmc s
     .param pmc args :slurpy
-	#.param pmc key :named :optional
+	#.param pmc key :named :optional        XXX
 
 	.local pmc iter, result
 
 =cut
 
 .sub 'object'
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item oct(x)
 
 .sub 'oct'
     .param pmc x
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
     .param pmc filename
     .param pmc mode :optional
     .param pmc bufsize :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item ord(c)
     .param pmc fset :optional
     .param pmc fdel :optional
     .param pmc doc :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'raw_input'
     .param pmc prompt :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
     .param pmc function
     .param pmc sequence
     .param pmc initializer :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'reload'
     .param pmc module
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'reversed'
     .param pmc seq
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item round(x[, n])
 .sub 'round'
     .param pmc x
     .param pmc n :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item set([iterable])
 
 .sub 'set'
     .param pmc iterable :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item setattr(object, name, value)
     .param pmc obj
     .param pmc name
     .param pmc value
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item slice([start,] stop[, step])
     .param pmc start #:optional?
     .param pmc stop
     .param pmc step :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
     .param pmc cmp :optional
     .param pmc key :optional
     .param pmc reverse :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'staticmethod'
     .param pmc function
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 .sub 'super'
     .param pmc type
     .param pmc obj_or_type :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'tuple'
     .param pmc sequence :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'type' :multi(pmc)
     .param pmc obj
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
     .param pmc name
     .param pmc bases
     .param pmc dict
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 
 .sub 'unichr'
     .param int i
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
     .param pmc obj      :optional
     .param pmc encoding :optional
     .param pmc errors   :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 =item vars([object])
 
 .sub 'vars'
     .param pmc obj :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
     .param pmc start #:optional?
     .param pmc stop
     .param pmc step :optional
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end
 
 
 .sub 'zip'
     .param pmc iterable :optional
     .param pmc args :slurpy
+
+    $P0 = new 'Exception'
+    $P0 = 'NotImplementedError'      # XXX
+    throw $P0
 .end