Author: Ronan Lamy <[email protected]>
Branch: 
Changeset: r73966:2ae04cf3f6eb
Date: 2014-10-15 15:20 +0100
http://bitbucket.org/pypy/pypy/changeset/2ae04cf3f6eb/

Log:    simplify signature of HLOperation.consider()

diff --git a/rpython/annotator/annrpython.py b/rpython/annotator/annrpython.py
--- a/rpython/annotator/annrpython.py
+++ b/rpython/annotator/annrpython.py
@@ -579,7 +579,7 @@
         for arg in op.args:
             if isinstance(self.annotation(arg), annmodel.SomeImpossibleValue):
                 raise BlockedInference(self, op, -1)
-        resultcell = op.consider(self, *op.args)
+        resultcell = op.consider(self)
         if resultcell is None:
             resultcell = annmodel.s_ImpossibleValue
         elif resultcell == annmodel.s_ImpossibleValue:
diff --git a/rpython/flowspace/operation.py b/rpython/flowspace/operation.py
--- a/rpython/flowspace/operation.py
+++ b/rpython/flowspace/operation.py
@@ -96,10 +96,10 @@
     def constfold(self):
         return None
 
-    def consider(self, annotator, *args):
-        args_s = [annotator.annotation(arg) for arg in args]
+    def consider(self, annotator):
+        args_s = [annotator.annotation(arg) for arg in self.args]
         spec = type(self).get_specialization(*args_s)
-        return spec(annotator, *args)
+        return spec(annotator, *self.args)
 
     def get_can_only_throw(self, annotator):
         return None
@@ -447,7 +447,7 @@
     opname = 'newdict'
     canraise = []
 
-    def consider(self, annotator, *args):
+    def consider(self, annotator):
         return annotator.bookkeeper.newdict()
 
 
@@ -456,16 +456,17 @@
     pyfunc = staticmethod(lambda *args: args)
     canraise = []
 
-    def consider(self, annotator, *args):
-        return SomeTuple(items=[annotator.annotation(arg) for arg in args])
+    def consider(self, annotator):
+        return SomeTuple(items=[annotator.annotation(arg) for arg in 
self.args])
 
 
 class NewList(HLOperation):
     opname = 'newlist'
     canraise = []
 
-    def consider(self, annotator, *args):
-        return annotator.bookkeeper.newlist(*[annotator.annotation(arg) for 
arg in args])
+    def consider(self, annotator):
+        return annotator.bookkeeper.newlist(
+                *[annotator.annotation(arg) for arg in self.args])
 
 
 class Pow(PureOperation):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to