我无法删除文件创建numpy.memmap功能
class MyClass
def __init__(self):
self.fp = np.memmap(filename, dtype='float32', mode='w+', shape=flushed_chunk_shape)
...
def __del__(self):
del self.fp
os.remove(filename)
当我运行del myclass(MyClass 的实例)时出现错误WindowsError: [Error 32] The process cannot access the file。如果我memmap以不面向对象的方式使用和删除文件,一切正常。所以我认为析构函数有问题。但为什么会发生呢?