summaryrefslogtreecommitdiff
path: root/numpy/core/memmap.py
diff options
context:
space:
mode:
authorStefan van der Walt <stefan@sun.ac.za>2008-02-22 08:58:25 +0000
committerStefan van der Walt <stefan@sun.ac.za>2008-02-22 08:58:25 +0000
commit3a9c9221c44f226cb4b29922454e4608d82f9c3d (patch)
tree05a4e6c5fc9b83f9f47144cb5beb1d49dc639a81 /numpy/core/memmap.py
parent16eddde4d400e82f00f59379228813885828b116 (diff)
downloadnumpy-3a9c9221c44f226cb4b29922454e4608d82f9c3d.tar.gz
Deprecate 'sync' in favour of 'flush'.
Diffstat (limited to 'numpy/core/memmap.py')
-rw-r--r--numpy/core/memmap.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py
index 4206ae7d9..a4baf5573 100644
--- a/numpy/core/memmap.py
+++ b/numpy/core/memmap.py
@@ -1,6 +1,7 @@
__all__ = ['memmap']
import mmap
+import warnings
from numeric import uint8, ndarray, dtype
dtypedescr = dtype
@@ -206,11 +207,16 @@ class memmap(ndarray):
else:
self._mmap = None
- def sync(self):
+ def flush(self):
"""Flush any changes in the array to the file on disk."""
if self._mmap is not None:
self._mmap.flush()
+ def sync(self):
+ """Flush any changes in the array to the file on disk."""
+ warnings.warn("Use ``flush``.", DeprecationWarning)
+ self.flush()
+
def close(self):
"""Close the memmap file."""
if (self.base is self._mmap):
@@ -220,7 +226,7 @@ class memmap(ndarray):
"by another object."
def __del__(self):
- self.sync()
+ self.flush()
try:
self.close()
except ValueError: