[pypy-svn] r4944 - pypy/branch/src-newobjectmodel/pypy/objspace/std

arigo at codespeak.net arigo at codespeak.net
Sat Jun 5 12:43:42 CEST 2004


Author: arigo
Date: Sat Jun  5 12:43:42 2004
New Revision: 4944

Modified:
   pypy/branch/src-newobjectmodel/pypy/objspace/std/stdtypedef.py
Log:
A previous code reorganization broke the algorithm to check for __lt__
vs. __gt__.


Modified: pypy/branch/src-newobjectmodel/pypy/objspace/std/stdtypedef.py
==============================================================================
--- pypy/branch/src-newobjectmodel/pypy/objspace/std/stdtypedef.py	(original)
+++ pypy/branch/src-newobjectmodel/pypy/objspace/std/stdtypedef.py	Sat Jun  5 12:43:42 2004
@@ -69,8 +69,7 @@
             result.append(value)
     return result
 
-def slicemultimethod(multimethod, typeclass):
-    result = {}
+def slicemultimethod(multimethod, typeclass, result):
     for i in range(len(multimethod.specialnames)):
         # each MultimethodCode embeds a multimethod
         name = multimethod.specialnames[i]
@@ -88,16 +87,15 @@
                 mmframeclass = MmFrame
         code = MultimethodCode(multimethod, mmframeclass, typeclass, i)
         result[name] = code
-    return result
 
 def slicemultimethods(spaceclass, typeclass):
     result = {}
     # import and slice all multimethods of the space.MM container
     for multimethod in hack_out_multimethods(spaceclass.MM.__dict__):
-        result.update(slicemultimethod(multimethod, typeclass))
+        slicemultimethod(multimethod, typeclass, result)
     # import all multimethods defined directly on the type without slicing
     for multimethod in typeclass.local_multimethods:
-        result.update(slicemultimethod(multimethod, None))
+        slicemultimethod(multimethod, None, result)
     # add some more multimethods with a special interface
     code = MultimethodCode(spaceclass.MM.next, MmFrame, typeclass)
     result['next'] = code



More information about the Pypy-commit mailing list