Author: Maciej Fijalkowski <[email protected]>
Branch: numpy-multidim
Changeset: r48591:cd07f23f15fc
Date: 2011-10-28 22:09 +0200
http://bitbucket.org/pypy/pypy/changeset/cd07f23f15fc/
Log: make shape and chunk immutable. no real benefits unless some array
is constant.
diff --git a/pypy/module/micronumpy/interp_numarray.py
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -71,6 +71,8 @@
class BaseArray(Wrappable):
_attrs_ = ["invalidates", "signature", "shape"]
+ _immutable_fields_ = ['shape[*]']
+
def __init__(self, shape):
self.invalidates = []
self.shape = shape
@@ -577,6 +579,8 @@
class NDimSlice(ViewArray):
signature = signature.BaseSignature()
+ _immutable_fields_ = ['shape[*]', 'chunks[*]']
+
def __init__(self, parent, signature, chunks, shape):
ViewArray.__init__(self, parent, signature, shape)
self.chunks = chunks
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit