[pypy-svn] r10411 - pypy/dist/pypy/objspace/std
arigo at codespeak.net
arigo at codespeak.net
Thu Apr 7 20:14:53 CEST 2005
Author: arigo
Date: Thu Apr 7 20:14:52 2005
New Revision: 10411
Modified:
pypy/dist/pypy/objspace/std/objspace.py
Log:
Reintroduce a lost check-in from pedronis:
""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 Thu Apr 7 20:14:52 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