Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r48071:1f3d56c3352f
Date: 2011-10-15 14:04 +0200
http://bitbucket.org/pypy/pypy/changeset/1f3d56c3352f/

Log:    Baaah. Fought for a while before realizing that it was because I
        mistakenly wrote "_immutable_ = ['field']". Grr. Should not occur
        again with this extra check.

diff --git a/pypy/rpython/rclass.py b/pypy/rpython/rclass.py
--- a/pypy/rpython/rclass.py
+++ b/pypy/rpython/rclass.py
@@ -191,6 +191,10 @@
                     "class %r inherits from its parent _immutable_=True, "
                     "so it should also declare _immutable_=True" % (
                     self.classdef,))
+            if loc.classdict.get('_immutable_').value is not True:
+                raise TyperError(
+                    "class %r: _immutable_ = something else than True" % (
+                    self.classdef,))
             hints = hints.copy()
             hints['immutable'] = True
         self.immutable_field_set = set()  # unless overwritten below
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to