[pypy-commit] pypy default: specify _immutable_fields_ for the types

bdkearns noreply at buildbot.pypy.org
Tue Oct 29 20:33:16 CET 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r67703:b85f930a0afa
Date: 2013-10-29 14:11 -0400
http://bitbucket.org/pypy/pypy/changeset/b85f930a0afa/

Log:	specify _immutable_fields_ for the types

diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -115,6 +115,7 @@
 class BaseType(object):
     SortRepr = None # placeholders for sorting classes, overloaded in sort.py
     Sort = None
+    _immutable_fields_ = ['native']
 
     def __init__(self, native=True):
         self.native = native
@@ -1570,6 +1571,8 @@
         ComponentBoxType = interp_boxes.W_FloatLongBox
 
 class BaseStringType(BaseType):
+    _immutable_fields = ['size']
+
     def __init__(self, size=0):
         BaseType.__init__(self)
         self.size = size
@@ -1770,6 +1773,7 @@
 
 class RecordType(BaseType):
     T = lltype.Char
+    _immutable_fields_ = ['offsets_and_fields', 'size']
 
     def __init__(self, offsets_and_fields, size):
         BaseType.__init__(self)


More information about the pypy-commit mailing list