diff --git a/numpy_ringbuffer/__init__.py b/numpy_ringbuffer/__init__.py index 95a5130..b188a35 100644 --- a/numpy_ringbuffer/__init__.py +++ b/numpy_ringbuffer/__init__.py @@ -53,7 +53,9 @@ def is_full(self): return len(self) == self._capacity # numpy compatibility - def __array__(self): + def __array__(self, copy=True): + if not copy: + raise ValueError("Cannot create a numpy array without copying. Pass copy=True.") return self._unwrap() @property