[pypy-commit] pypy default: move ever_mutated attribute where it belongs

cfbolz noreply at buildbot.pypy.org
Fri Jan 23 10:40:48 CET 2015


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: 
Changeset: r75490:d57e4d7adf30
Date: 2015-01-23 00:28 +0100
http://bitbucket.org/pypy/pypy/changeset/d57e4d7adf30/

Log:	move ever_mutated attribute where it belongs

diff --git a/pypy/objspace/std/mapdict.py b/pypy/objspace/std/mapdict.py
--- a/pypy/objspace/std/mapdict.py
+++ b/pypy/objspace/std/mapdict.py
@@ -20,7 +20,7 @@
 # we want to propagate knowledge that the result cannot be negative
 
 class AbstractAttribute(object):
-    _immutable_fields_ = ['terminator', 'ever_mutated?']
+    _immutable_fields_ = ['terminator']
     cache_attrs = None
     _size_estimate = 0
 
@@ -28,7 +28,6 @@
         self.space = space
         assert isinstance(terminator, Terminator)
         self.terminator = terminator
-        self.ever_mutated = False
 
     def read(self, obj, selector):
         attr = self.find_map_attr(selector)
@@ -276,13 +275,15 @@
         return Terminator.set_terminator(self, obj, terminator)
 
 class PlainAttribute(AbstractAttribute):
-    _immutable_fields_ = ['selector', 'storageindex', 'back']
+    _immutable_fields_ = ['selector', 'storageindex', 'back', 'ever_mutated?']
+
     def __init__(self, selector, back):
         AbstractAttribute.__init__(self, back.space, back.terminator)
         self.selector = selector
         self.storageindex = back.length()
         self.back = back
         self._size_estimate = self.length() * NUM_DIGITS_POW2
+        self.ever_mutated = False
 
     def _copy_attr(self, obj, new_obj):
         w_value = self.read(obj, self.selector)


More information about the pypy-commit mailing list