[Numpy-discussion] Accessing array members

Travis Oliphant oliphant at ee.byu.edu
Mon Dec 2 15:33:01 EST 2002

On 2 Dec 2002, Konrad Hinsen wrote:

> Joachim Saul <list at jsaul.de> writes:
> > But what if I create a reference to foo.bar, and later delete foo,
> > i.e.
> >
> > >>> b = foo.bar
> > >>> del foo

> >
> > Now the data pointer in b refers to freed data! In the mentioned

Forgive me for jumping in.  But why should the data be deleted when you do
this?  Shouldn't del foo merely decrease the reference count of foo.bar?
Because there are still outstanding references to foo.bar (i.e. b)  then
the data itself shouldn't be freed.

Perhaps I don't understand the question well enough.


More information about the NumPy-Discussion mailing list