[pypy-svn] r10368 - pypy/dist/pypy/objspace/std

pedronis at codespeak.net pedronis at codespeak.net
Wed Apr 6 17:13:08 CEST 2005


Author: pedronis
Date: Wed Apr  6 17:13:07 2005
New Revision: 10368

Modified:
   pypy/dist/pypy/objspace/std/objspace.py
Log:
don't pollute *_w results with the logic for wrapped object returning mms



Modified: pypy/dist/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/std/objspace.py	(original)
+++ pypy/dist/pypy/objspace/std/objspace.py	Wed Apr  6 17:13:07 2005
@@ -40,12 +40,15 @@
         # install all the MultiMethods into the space instance
         for name, mm in self.MM.__dict__.items():
             if isinstance(mm, MultiMethod) and not hasattr(self, name):
-                exprargs, expr, miniglobals, fallback = (
-                    mm.install_not_sliced(self.model.typeorder, baked_perform_call=False))
-
-                func = stdtypedef.make_perform_trampoline('__mm_'+name,
-                                                          exprargs, expr, miniglobals,
-                                                          mm)
+                if name.endswith('_w'): # int_w, str_w...: these do not return a wrapped object
+                    func = mm.install_not_sliced(self.model.typeorder, baked_perform_call=True)
+                else:               
+                    exprargs, expr, miniglobals, fallback = (
+                        mm.install_not_sliced(self.model.typeorder, baked_perform_call=False))
+
+                    func = stdtypedef.make_perform_trampoline('__mm_'+name,
+                                                              exprargs, expr, miniglobals,
+                                                              mm)
                 
                                                   # e.g. add(space, w_x, w_y)
                 boundmethod = func.__get__(self)  # bind the 'space' argument



More information about the Pypy-commit mailing list