[pypy-commit] pypy var-in-Some: register annotators for op.simple_call and op.call_args

rlamy noreply at buildbot.pypy.org
Wed May 21 18:49:38 CEST 2014


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: var-in-Some
Changeset: r71630:e8f43ee8a19e
Date: 2014-05-21 04:53 +0100
http://bitbucket.org/pypy/pypy/changeset/e8f43ee8a19e/

Log:	register annotators for op.simple_call and op.call_args

diff --git a/rpython/annotator/unaryop.py b/rpython/annotator/unaryop.py
--- a/rpython/annotator/unaryop.py
+++ b/rpython/annotator/unaryop.py
@@ -44,6 +44,14 @@
     return s_Bool
 contains_SomeObject.can_only_throw = []
 
+ at op.simple_call.register(SomeObject)
+def simple_call_SomeObject(func, *args):
+    return func.ann.call(simple_args([arg.ann for arg in args]))
+
+ at op.call_args.register(SomeObject)
+def call_args(func, *args):
+    return func.ann.call(complex_args([arg.ann for arg in args]))
+
 class __extend__(SomeObject):
 
     def issubtype(self, s_cls):
@@ -131,12 +139,6 @@
     def bind_callables_under(self, classdef, name):
         return self   # default unbound __get__ implementation
 
-    def simple_call(self, *args_s):
-        return self.call(simple_args(args_s))
-
-    def call_args(self, *args_s):
-        return self.call(complex_args(args_s))
-
     def call(self, args, implicit_init=False):
         raise AnnotatorError("Cannot prove that the object is callable")
 
@@ -695,9 +697,6 @@
         return s_next.call(simple_args([]))
 
 class __extend__(SomeBuiltin):
-    def simple_call(self, *args):
-        return self.analyser(*args)
-
     def call(self, args, implicit_init=False):
         args_s, kwds = args.unpack()
         # prefix keyword arguments with 's_'


More information about the pypy-commit mailing list