[Numpy-discussion] is ndarray.base the closest base or the ultimate base?

Hans Meine meine@informatik.uni-hamburg...
Mon Sep 21 06:28:41 CDT 2009


Hi!

On Monday 21 September 2009 12:31:27 Citi, Luca wrote:
> I think you do not need to do the  chain up walk on view creation.
> If the assumption is that base is the ultimate base, on view creation
> you can do something like (pseudo-code):
> view.base = parent if parent.owndata else parent.base

Hmm.  My impression was that .base was for refcounting purposes *only*.  Thus, 
it is not even guaranteed that the attribute value is an array(-like) object.

For example, I might want to allow direct access to some internal buffers of 
an object of mine in an extension module; then, I'd use .base to bind the 
lifetime of my object to the array (the lifetime of which I cannot control 
anymore).

Ciao,
  Hans


More information about the NumPy-Discussion mailing list