[Numpy-discussion] List Array References?

Stefan van der Walt stefan at sun.ac.za
Fri Feb 15 07:12:41 EST 2008


Hi Alexander

On Thu, Feb 14, 2008 at 03:43:46PM -0500, Alexander Michael wrote:
> Is there a way to list all of the arrays that are referencing a given
> array? Similarly, is there a way to get a list of all arrays that are
> currently in memory?

As far as I know, the reference count to the array is increased when
you create a view, but the views themselves are not tracked anywhere.
You can therefore say whether there are references around, but you
cannot identify the Python objects.

I'm curious why you need this information -- maybe there is an
alternative solution to your problem?

Regards
Stéfan



More information about the NumPy-Discussion mailing list