[pypy-commit] pypy faster-nested-scopes: make Cell.w_value quasi-immutable. This is useful for inner functions that survive their defining scope.

cfbolz noreply at buildbot.pypy.org
Sat Jul 16 00:12:56 CEST 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: faster-nested-scopes
Changeset: r45650:ccb04f0a55e9
Date: 2011-07-15 19:33 +0200
http://bitbucket.org/pypy/pypy/changeset/ccb04f0a55e9/

Log:	make Cell.w_value quasi-immutable. This is useful for inner
	functions that survive their defining scope.

diff --git a/pypy/interpreter/nestedscope.py b/pypy/interpreter/nestedscope.py
--- a/pypy/interpreter/nestedscope.py
+++ b/pypy/interpreter/nestedscope.py
@@ -8,7 +8,8 @@
 
 class Cell(Wrappable):
     "A simple container for a wrapped value."
-    
+    _immutable_fields_ = ["w_value?"]
+
     def __init__(self, w_value=None):
         self.w_value = w_value
 


More information about the pypy-commit mailing list