Author: Ronan Lamy <[email protected]>
Branch: flowoperators
Changeset: r65214:eecbf0a00b93
Date: 2013-05-03 16:57 +0100
http://bitbucket.org/pypy/pypy/changeset/eecbf0a00b93/

Log:    Kill operation.Arity

diff --git a/rpython/flowspace/operation.py b/rpython/flowspace/operation.py
--- a/rpython/flowspace/operation.py
+++ b/rpython/flowspace/operation.py
@@ -321,10 +321,6 @@
             FunctionByName[name] = func
         if func not in OperationName:
             OperationName[func] = name
-    # check that the result is complete
-    for name, oper in vars(op).iteritems():
-        Arity[name] = oper.arity
-        assert name in FunctionByName
 setup()
 del Table, setup # INTERNAL ONLY, use the dicts declared at the top of the file
 
diff --git a/rpython/flowspace/specialcase.py b/rpython/flowspace/specialcase.py
--- a/rpython/flowspace/specialcase.py
+++ b/rpython/flowspace/specialcase.py
@@ -1,5 +1,5 @@
 from rpython.flowspace.model import Constant
-from rpython.flowspace.operation import OperationName, Arity
+from rpython.flowspace.operation import OperationName, op
 from rpython.rlib.rarithmetic import r_uint
 from rpython.rlib.objectmodel import we_are_translated
 
@@ -10,14 +10,15 @@
 
 def sc_operator(space, fn, args_w):
     opname = OperationName[fn]
-    if len(args_w) != Arity[opname]:
+    oper = getattr(op, opname)
+    if len(args_w) != oper.arity:
         if opname == 'pow' and len(args_w) == 2:
             args_w = args_w + [Constant(None)]
         elif opname == 'getattr' and len(args_w) == 3:
             return space.frame.do_operation('simple_call', Constant(getattr), 
*args_w)
         else:
             raise Exception("should call %r with exactly %d arguments" % (
-                fn, Arity[opname]))
+                fn, oper.arity))
     # completely replace the call with the underlying
     # operation and its limited implicit exceptions semantic
     return getattr(space, opname)(*args_w)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to