[pypy-svn] rev 697 - pypy/trunk/src/pypy/objspace/std

tomek at codespeak.net tomek at codespeak.net
Thu May 29 17:26:21 CEST 2003


Author: tomek
Date: Thu May 29 17:26:21 2003
New Revision: 697

Modified:
   pypy/trunk/src/pypy/objspace/std/stringobject.py
Log:
a small problem with is_


Modified: pypy/trunk/src/pypy/objspace/std/stringobject.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/stringobject.py	(original)
+++ pypy/trunk/src/pypy/objspace/std/stringobject.py	Thu May 29 17:26:21 2003
@@ -119,14 +119,20 @@
 NE = 6
 
 def string_richcompare(space, w_str1, w_str2, op):
+    print "string_richcompare ", w_str1, w_str2, op
     str1 = w_str1._value
     str2 = w_str2._value
 
-    if space.is_(str1, str2):
-        if op == EQ or op == LE or op == GE:
-            return space.w_True
-        elif op == GT or op == LT or op == NE:
-            return space.w_False
+    #There is still problem with it
+    #
+    #if space.is_(w_str1, w_str2):
+    #    print "Oooh, str1 and str2 are the same!"
+    #    if op == EQ or op == LE or op == GE:
+    #        return space.w_True
+    #    elif op == GT or op == LT or op == NE:
+    #        return space.w_False
+    if 0:
+        pass
     else:
         if op == EQ:
             if str1.len == str2.len:
@@ -159,6 +165,7 @@
             else:
                 c = 0
 
+        print "c is ", c
         if op == LT:
             return space.newbool(c < 0)
         elif op == LE:
@@ -197,9 +204,10 @@
 StdObjSpace.eq.register(str_str_eq, W_StringObject, W_StringObject)
 
 def str_str_ne(space, w_str1, w_str2):
-    i = w_str1._value.value()
-    j = w_str2._value.value()
-    return space.newbool( i != j )
+    #i = w_str1._value.value()
+    #j = w_str2._value.value()
+    #return space.newbool( i != j )
+    return string_richcompare(space, w_str1, w_str2, NE)
 StdObjSpace.ne.register(str_str_ne, W_StringObject, W_StringObject)
 
 def str_str_gt(space, w_str1, w_str2):


More information about the Pypy-commit mailing list