[Numpy-discussion] memmap close() and flush()

Fernando Perez fperez.net at gmail.com
Wed Jan 31 12:42:13 EST 2007

On 1/31/07, Travis Oliphant <oliphant.travis at ieee.org> wrote:
> Sebastian Haase wrote:
> > Hi!
> > Do numpy memmap have a way of explicitly
> > flushing data to disk
> > and/or
> > closing the memmap.
> >
> There is a sync method that performs the flush.   To close the memmap,
> delete it.
> More detail:
>     The memmap sub-class has a _mmap attribute that is the Python
> memory-map object.

Quick question out of ignorance: shouldn't the API offer an explicit
close method?  The reason is that in python, doing 'del foo' doesn't
ensure real deletion of the underlying object that  will fire the
close methods, since you may easily have other names pointing to the
same object.  Having an explicit, guaranteed way to call .close()
sounds  like a good thing to me, but I may well be missing something.



More information about the NumPy-Discussion mailing list