Author: Ronan Lamy <[email protected]>
Branch: less-stringly-ops
Changeset: r68274:9f4d8f565ab1
Date: 2013-11-19 08:25 +0000
http://bitbucket.org/pypy/pypy/changeset/9f4d8f565ab1/

Log:    remove nextra argument from rawshape()

diff --git a/rpython/annotator/argument.py b/rpython/annotator/argument.py
--- a/rpython/annotator/argument.py
+++ b/rpython/annotator/argument.py
@@ -175,15 +175,15 @@
             data_w.append(self.w_stararg)
         return (shape_cnt, shape_keys, shape_star), data_w
 
-    def _rawshape(self, nextra=0):
-        shape_cnt = len(self.arguments_w) + nextra  # Number of positional args
+    def _rawshape(self):
+        shape_cnt = len(self.arguments_w)
         shape_keys = tuple(sorted(self.keywords))
         shape_star = self.w_stararg is not None   # Flag: presence of *arg
         return shape_cnt, shape_keys, shape_star
 
 
-def rawshape(args, nextra=0):
-    return args._rawshape(nextra)
+def rawshape(args):
+    return args._rawshape()
 
 
 #
diff --git a/rpython/annotator/description.py b/rpython/annotator/description.py
--- a/rpython/annotator/description.py
+++ b/rpython/annotator/description.py
@@ -879,11 +879,12 @@
                                              self.name,
                                              flags)
 
+    @staticmethod
     def consider_call_site(bookkeeper, family, descs, args, s_result, op):
-        shape = rawshape(args, nextra=1)     # account for the extra 'self'
+        cnt, keys, star = rawshape(args)
+        shape = cnt + 1, keys, star  # account for the extra 'self'
         row = FunctionDesc.row_to_consider(descs, args, op)
         family.calltable_add_row(shape, row)
-    consider_call_site = staticmethod(consider_call_site)
 
     def rowkey(self):
         # we are computing call families and call tables that always contain
@@ -1039,11 +1040,12 @@
         args = args.prepend(s_self)
         return self.funcdesc.pycall(schedule, args, s_previous_result, op)
 
+    @staticmethod
     def consider_call_site(bookkeeper, family, descs, args, s_result, op):
-        shape = rawshape(args, nextra=1)    # account for the extra 'self'
+        cnt, keys, star = rawshape(args)
+        shape = cnt + 1, keys, star  # account for the extra 'self'
         row = FunctionDesc.row_to_consider(descs, args, op)
         family.calltable_add_row(shape, row)
-    consider_call_site = staticmethod(consider_call_site)
 
     def rowkey(self):
         return self.funcdesc
diff --git a/rpython/annotator/test/test_argument.py 
b/rpython/annotator/test/test_argument.py
--- a/rpython/annotator/test/test_argument.py
+++ b/rpython/annotator/test/test_argument.py
@@ -67,9 +67,6 @@
         args = MockArgs([1, 2, 3])
         assert rawshape(args) == (3, (), False)
 
-        args = MockArgs([1])
-        assert rawshape(args, 2) == (3, (), False)
-
         args = MockArgs([1, 2, 3, 4, 5])
         assert rawshape(args) == (5, (), False)
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to