  Dag Sverre Seljebotn d.s.seljebotn@astro.uio... Fri Mar 11
12:41:39 CST 2011  There's a few libraries out there that needs
to know whether or not an  array changed since the last time it
was used: joblib and pymc comes to  mind. I believe joblib
computes a SHA1 or md5 hash of array contents,  while pymc
simply assume you never change an array and uses the id().  The
pymc approach is fragile, while in my case the joblib approach
is  too expensive since I'll call the function again many times
in a row  with the same large array (yes, I can code around it,
but the code gets  less streamlined).  So, would it be possible
to very quickly detect whether a NumPy array is  guaranteed to
not have changed? Here's a revision counter approach:    1)
Introduce a new 64-bit int field "modification_count" in the
array  object struct.    2) modification_count is incremented
any time it is possible that an  array changes. In particular,
PyArray_DATA would increment the counter.    3) A new
PyArray_READONLYDATA is introduced