[pypy-commit] pypy ffi-backend: Use quasi-immutable fields here.

arigo noreply at buildbot.pypy.org
Sun Jul 29 15:48:13 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: ffi-backend
Changeset: r56498:4b82ae9bf23d
Date: 2012-07-28 19:13 +0200
http://bitbucket.org/pypy/pypy/changeset/4b82ae9bf23d/

Log:	Use quasi-immutable fields here.

diff --git a/pypy/module/_cffi_backend/ctypeobj.py b/pypy/module/_cffi_backend/ctypeobj.py
--- a/pypy/module/_cffi_backend/ctypeobj.py
+++ b/pypy/module/_cffi_backend/ctypeobj.py
@@ -10,7 +10,7 @@
 
 
 class W_CType(Wrappable):
-    _attrs_ = ['space', 'size', 'name', 'name_position']
+    _attrs_ = ['space', 'size?', 'name', 'name_position']
     _immutable_fields_ = _attrs_
 
     cast_anything = False
diff --git a/pypy/module/_cffi_backend/ctypestruct.py b/pypy/module/_cffi_backend/ctypestruct.py
--- a/pypy/module/_cffi_backend/ctypestruct.py
+++ b/pypy/module/_cffi_backend/ctypestruct.py
@@ -14,7 +14,8 @@
 
 
 class W_CTypeStructOrUnion(W_CType):
-    # not an _immutable_ class!
+    _attrs_ = ['alignment?', 'fields_list?', 'fields_dict?',
+               'custom_field_pos?']
     # fields added by complete_struct_or_union():
     alignment = -1
     fields_list = None


More information about the pypy-commit mailing list