Source

pypy / pypy / module / cppyy / ffitypes.py

Diff from to

pypy/module/cppyy/ffitypes.py

 
 class BoolTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
     libffitype  = jit_libffi.types.uchar
     c_type      = rffi.UCHAR
     c_ptrtype   = rffi.UCHARP
 
 class CharTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
     libffitype  = jit_libffi.types.schar
     c_type      = rffi.CHAR
     c_ptrtype   = rffi.CCHARP           # there's no such thing as rffi.CHARP
 
 class ShortTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
     libffitype  = jit_libffi.types.sshort
     c_type      = rffi.SHORT
     c_ptrtype   = rffi.SHORTP
 
 class UShortTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
     libffitype  = jit_libffi.types.ushort
     c_type      = rffi.USHORT
     c_ptrtype   = rffi.USHORTP
 
 class IntTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
     libffitype  = jit_libffi.types.sint
     c_type      = rffi.INT
     c_ptrtype   = rffi.INTP
 
 class UIntTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
     libffitype  = jit_libffi.types.uint
     c_type      = rffi.UINT
     c_ptrtype   = rffi.UINTP
 
 class LongTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
     libffitype  = jit_libffi.types.slong
     c_type      =  rffi.LONG
     c_ptrtype   = rffi.LONGP
 
 class ULongTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
     libffitype  = jit_libffi.types.ulong
     c_type      = rffi.ULONG
     c_ptrtype   = rffi.ULONGP
 
 class LongLongTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
     libffitype  = jit_libffi.types.sint64
     c_type      = rffi.LONGLONG
     c_ptrtype   = rffi.LONGLONGP
 
 class ULongLongTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
     libffitype  = jit_libffi.types.uint64
     c_type      = rffi.ULONGLONG
     c_ptrtype   = rffi.ULONGLONGP
 
 class FloatTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype', 'typecode']
+
     libffitype  = jit_libffi.types.float
     c_type      = rffi.FLOAT
     c_ptrtype   = rffi.FLOATP
 
 class DoubleTypeMixin(object):
     _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype', 'typecode']
+
     libffitype  = jit_libffi.types.double
     c_type      = rffi.DOUBLE
     c_ptrtype   = rffi.DOUBLEP