Skip to content

Commit 8341a52

Browse files
committed
Document close() as the preferred mmap-release path
close() is the explicit API; __del__ is a GC safety net. Empty __del__ docstring previously left the intent implicit. Per review feedback.
1 parent 902ed44 commit 8341a52

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kempnerforge/data/dataset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,11 @@ def _close_mmaps(self) -> None:
198198
self._mmaps.clear()
199199

200200
def close(self) -> None:
201-
"""Explicit cleanup for callers that want to release mmaps before GC."""
201+
"""Release the underlying mmaps. Preferred path; do not rely on ``__del__``."""
202202
self._close_mmaps()
203203

204204
def __del__(self) -> None:
205+
"""GC safety net only. Prefer explicit :meth:`close`."""
205206
with contextlib.suppress(Exception):
206207
self._close_mmaps()
207208

0 commit comments

Comments
 (0)