[Numpy-discussion] .transpose() of memmap array fails to close()

Anne Archibald peridot.faceted@gmail....
Mon Aug 13 23:23:26 CDT 2007


On 13/08/07, Glen W. Mabey <Glen.Mabey@swri.org> wrote:

> As I have tried to think through what should be the appropriate
> behavior for the returned value of __getitem__, I have not been able to
> see an appropriate solution (let alone know how to implement it) to this
> issue.

Is the problem one of finalization? That is, making sure the memory
map gets (flushed and) closed exactly once? In this case the
numpythonic solution is to have only the original mmap object do any
finalization; any slices contain a reference to it anyway, so they
cannot be kept after it is collected. If the problem is that you want
to do an explicit close/flush on a slice object, you could just always
apply the close/flush to the base object of the slice if it has one or
the slice itself if it doesn't.

I'm afraid I don't really understand the problem but it seems like
nobody who just knows the answer is about to speak up...

Anne


More information about the Numpy-discussion mailing list