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

hpk at codespeak.net hpk at codespeak.net
Tue Aug 23 20:30:39 CEST 2005


Author: hpk
Date: Tue Aug 23 20:30:38 2005
New Revision: 16340

Modified:
   pypy/dist/pypy/objspace/std/dictobject.py
Log:
(hpk,arigo)

fix compliancy test_userdict.py in a slightly weird 
way (but it appears to work) 



Modified: pypy/dist/pypy/objspace/std/dictobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/dictobject.py	(original)
+++ pypy/dist/pypy/objspace/std/dictobject.py	Tue Aug 23 20:30:38 2005
@@ -224,13 +224,17 @@
         return space.w_False
     w_rightdiff, w_rightval = characterize(space, w_right.data, w_left)
     w_res = space.w_False
-    if w_rightdiff is not None:
-        w_res = space.lt(w_leftdiff, w_rightdiff)
-    if space.is_w(w_res, space.w_False) and space.eq_w(w_leftdiff, w_rightdiff) and w_rightval is not None:
+    if w_rightdiff is None:
+        # w_leftdiff is not None, w_rightdiff is None
+        return space.w_True 
+    w_isequal = space.eq(w_leftdiff, w_rightdiff)
+    w_res = space.lt(w_leftdiff, w_rightdiff)
+    if (space.is_w(w_res, space.w_False) and 
+        space.is_true(w_isequal) and 
+        w_rightval is not None):
         w_res = space.lt(w_leftval, w_rightval)
     return w_res
 
-
 def hash__Dict(space,w_dict):
     raise OperationError(space.w_TypeError,space.wrap("dict objects are unhashable"))
 



More information about the Pypy-commit mailing list