wlav avatar wlav committed 0fdb7d8

remove now superfluous return type handling and executors' name data members

Comments (0)

Files changed (2)

pypy/module/cppyy/executor.py

     _immutable_ = True
     libffitype = NULL
 
-    def __init__(self, space, name, cpptype):
-        self.name = name
+    def __init__(self, space, cpptype):
+        pass
 
     def execute(self, space, cppmethod, cppthis, num_args, args):
-        raise TypeError('return type not available or supported ("%s")' % self.name)
+        raise TypeError('return type not available or supported')
 
     def execute_libffi(self, space, libffifunc, argchain):
         from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
     _immutable_ = True
     libffitype = libffi.types.pointer
 
-    def __init__(self, space, name, cpptype):
-        FunctionExecutor.__init__(self, space, name, cpptype)
+    def __init__(self, space, cpptype):
+        FunctionExecutor.__init__(self, space, cpptype)
         self.cpptype = cpptype
 
     def execute(self, space, cppmethod, cppthis, num_args, args):
 
     #   1) full, qualified match
     try:
-        return _executors[name](space, "", None)
+        return _executors[name](space, None)
     except KeyError:
         pass
 
 
     #   1a) clean lookup
     try:
-        return _executors[clean_name+compound](space, "", None)
+        return _executors[clean_name+compound](space, None)
     except KeyError:
         pass
 
     if compound and compound[len(compound)-1] == "&":
         # TODO: this does not actually work with Reflex (?)
         try:
-            return _executors[clean_name](space, "", None)
+            return _executors[clean_name](space, None)
         except KeyError:
             pass
 
         from pypy.module.cppyy.interp_cppyy import W_CPPType
         cpptype = space.interp_w(W_CPPType, cpptype, can_be_None=False)
         if compound == "":
-            return InstanceExecutor(space, clean_name, cpptype)
+            return InstanceExecutor(space, cpptype)
         elif compound == "*" or compound == "&":
-            return InstancePtrExecutor(space, clean_name, cpptype)
+            return InstancePtrExecutor(space, cpptype)
         elif compound == "**" or compound == "*&":
-            return InstancePtrPtrExecutor(space, clean_name, cpptype)
+            return InstancePtrPtrExecutor(space, cpptype)
     elif capi.c_is_enum(clean_name):
-        return UnsignedIntExecutor(space, "", None)
+        return UnsignedIntExecutor(space, None)
 
     # 4) additional special cases
     # ... none for now
 
     # currently used until proper lazy instantiation available in interp_cppyy
-    return FunctionExecutor(space, "", None)
+    return FunctionExecutor(space, None)
  
  #  raise TypeError("no clue what %s is" % name)
 

pypy/module/cppyy/interp_cppyy.py

     def is_static(self):
         return self.space.wrap(isinstance(self.functions[0], CPPFunction))
 
-    def get_returntype(self):
-        return self.space.wrap(self.functions[0].executor.name)
-
     @jit.unroll_safe
     def call(self, w_cppinstance, args_w):
         cppinstance = self.space.interp_w(W_CPPInstance, w_cppinstance, can_be_None=True)
 W_CPPOverload.typedef = TypeDef(
     'CPPOverload',
     is_static = interp2app(W_CPPOverload.is_static, unwrap_spec=['self']),
-    get_returntype = interp2app(W_CPPOverload.get_returntype, unwrap_spec=['self']),
     call = interp2app(W_CPPOverload.call, unwrap_spec=['self', W_Root, 'args_w']),
 )
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.