From: Stefan Behnel Date: Fri, 3 Dec 2010 20:17:30 +0000 (+0100) Subject: made fields of builtin objects immutable X-Git-Tag: 0.14.alpha0~30 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0e4c930b3ee136350c185eb0c02bb34ec84ea238;p=cython.git made fields of builtin objects immutable --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index f6966165..d721a69e 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -3451,7 +3451,9 @@ class AttributeNode(ExprNode): if not target: self.is_temp = 1 self.result_ctype = py_object_type - + elif target and self.obj.type.is_builtin_type: + error(self.pos, "Assignment to an immutable object field") + def analyse_attribute(self, env, obj_type = None): # Look up attribute and set self.type and self.member. self.is_py_attr = 0