[pypy-svn] r32046 - in pypy/dist/pypy: annotation rpython

pedronis at codespeak.net pedronis at codespeak.net
Thu Sep 7 13:21:51 CEST 2006


Author: pedronis
Date: Thu Sep  7 13:21:49 2006
New Revision: 32046

Modified:
   pypy/dist/pypy/annotation/listdef.py
   pypy/dist/pypy/rpython/rlist.py
Log:
(arigo, pedronis)

reverting checkin from outer-space: listitem are meant to be compared by identity, listdefs unify
by sharing identical listitems.




Modified: pypy/dist/pypy/annotation/listdef.py
==============================================================================
--- pypy/dist/pypy/annotation/listdef.py	(original)
+++ pypy/dist/pypy/annotation/listdef.py	Thu Sep  7 13:21:49 2006
@@ -109,15 +109,6 @@
             for position_key in self.read_locations:
                 self.bookkeeper.annotator.reflowfromposition(position_key)
         return updated
-    
-    def __eq__(self, other):
-        return self.s_value is other.s_value or self.s_value == other.s_value
-    
-    def __ne__(self, other):
-        return self.s_value is not other.s_value and self.s_value != other.s_value
-    
-    def __hash__(self):
-        return hash(self.s_value)
 
 
 class ListDef:
@@ -147,7 +138,7 @@
         return self.listitem.s_value
 
     def same_as(self, other):
-        return self.listitem == other.listitem
+        return self.listitem is other.listitem
 
     def union(self, other):
         if (self.same_as(MOST_GENERAL_LISTDEF) or

Modified: pypy/dist/pypy/rpython/rlist.py
==============================================================================
--- pypy/dist/pypy/rpython/rlist.py	(original)
+++ pypy/dist/pypy/rpython/rlist.py	Thu Sep  7 13:21:49 2006
@@ -242,7 +242,7 @@
     def convert_from_to((r_lst1, r_lst2), v, llops):
         if r_lst1.listitem is None or r_lst2.listitem is None:
             return NotImplemented
-        if r_lst1.listitem != r_lst2.listitem:
+        if r_lst1.listitem is not r_lst2.listitem:
             return NotImplemented
         return v
 



More information about the Pypy-commit mailing list