[pypy-commit] pypy default: merge heads

mattip noreply at buildbot.pypy.org
Thu Mar 26 04:57:23 CET 2015


Author: mattip <matti.picus at gmail.com>
Branch: 
Changeset: r76565:fcd88928b3e9
Date: 2015-03-26 05:58 +0200
http://bitbucket.org/pypy/pypy/changeset/fcd88928b3e9/

Log:	merge heads

diff --git a/rpython/annotator/listdef.py b/rpython/annotator/listdef.py
--- a/rpython/annotator/listdef.py
+++ b/rpython/annotator/listdef.py
@@ -83,9 +83,6 @@
                 self.setrangestep(self._step_map[type(self.range_step),
                                                  type(other.range_step)])
             self.itemof.update(other.itemof)
-            read_locations = self.read_locations.copy()
-            other_read_locations = other.read_locations.copy()
-            self.read_locations.update(other.read_locations)
             s_value = self.s_value
             s_other_value = other.s_value
             s_new_value = unionof(s_value, s_other_value)
@@ -95,18 +92,20 @@
             self.patch()    # which should patch all refs to 'other'
             if s_new_value != s_value:
                 self.s_value = s_new_value
-                # reflow from reading points
-                for position_key in read_locations:
-                    self.bookkeeper.annotator.reflowfromposition(position_key) 
+                self.notify_update()
             if s_new_value != s_other_value:
-                # reflow from reading points
-                for position_key in other_read_locations:
-                    other.bookkeeper.annotator.reflowfromposition(position_key)
+                other.notify_update()
+            self.read_locations.update(other.read_locations)
 
     def patch(self):
         for listdef in self.itemof:
             listdef.listitem = self
 
+    def notify_update(self):
+        '''Reflow from all reading points'''
+        for position_key in self.read_locations:
+            self.bookkeeper.annotator.reflowfromposition(position_key)
+
     def generalize(self, s_other_value):
         s_new_value = unionof(self.s_value, s_other_value)
         updated = s_new_value != self.s_value
@@ -114,9 +113,7 @@
             if self.dont_change_any_more:
                 raise TooLateForChange
             self.s_value = s_new_value
-            # reflow from all reading points
-            for position_key in self.read_locations:
-                self.bookkeeper.annotator.reflowfromposition(position_key)
+            self.notify_update()
         return updated
 
 
diff --git a/rpython/annotator/test/test_model.py b/rpython/annotator/test/test_model.py
--- a/rpython/annotator/test/test_model.py
+++ b/rpython/annotator/test/test_model.py
@@ -37,6 +37,10 @@
                                            (s4, s4), (s4, s6),
                                                      (s6, s6)])
 
+def test_signedness():
+    assert not SomeInteger(unsigned=True).contains(SomeInteger())
+    assert SomeInteger(unsigned=True).contains(SomeInteger(nonneg=True))
+
 def test_commonbase_simple():
     class A0:
         pass


More information about the pypy-commit mailing list