2

ファイル作成機能が削除でき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オブジェクト指向ではない方法でファイルを使用および削除すると、すべて問題ありません。なので、デストラクタでのトラブルを考えます。しかし、なぜそれが起こるのですか?

4

1 に答える 1