[Numpy-discussion] Views of memmaps and offset
olivier.grisel at ensta.org
Sun Sep 23 14:55:19 EDT 2012
2012/9/23 Olivier Grisel <olivier.grisel at ensta.org>:
> The only clean solution for the collapsed base of numpy 1.7 I see
> would be to replace the direct mmap.mmap buffer instance from the
> numpy.memmap class to use a custom wrapper of mmap.mmap that would
> still implement the buffer python API but would also store the
> filename and offset as additional attributes. To me that sounds like a
> much cleaner than a "global scorecard of all extant memory mappings".
Rather than a wrapper for mmap.mmap we could just subclass it actually.
This is even cleaner: very few code change and would not break user
code testing for `isintance(a.base, mmap.mmap)` or similar.
http://twitter.com/ogrisel - http://github.com/ogrisel
More information about the NumPy-Discussion