Commits

timfel  committed 4830ce6

try to improve byteobject comparisons

  • Participants
  • Parent commits 2d1aef2

Comments (0)

Files changed (1)

File spyvm/model.py

         return True
 
     def is_same_object(self, other):
+        if self is other:
+            return True
         # XXX this sounds very wrong to me
-        if not isinstance(other, W_BytesObject):
+        elif not isinstance(other, W_BytesObject):
             return False
         size = self.size()
         if size != other.size():
             return False
-        if size > 256 and self.bytes is not None and other.bytes is not None:
+        elif size > 256 and self.bytes is not None and other.bytes is not None:
             return self.bytes == other.bytes
         else:
             return self.has_same_chars(other, size)