Skip to content

Commit 8d633d2

Browse files
committed
Add comment explaining file write method takes any object supporting the buffer protocol
1 parent 6ad144d commit 8d633d2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/zarr/storage/_local.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def _put(
5151
if start is not None:
5252
with path.open("r+b") as f:
5353
f.seek(start)
54+
# write takes any object supporting the buffer protocol
5455
f.write(value.as_numpy_array()) # type: ignore[arg-type]
5556
return None
5657
else:
@@ -60,6 +61,7 @@ def _put(
6061
else:
6162
mode = "wb"
6263
with path.open(mode=mode) as f:
64+
# write takes any object supporting the buffer protocol
6365
return f.write(view)
6466

6567

0 commit comments

Comments
 (0)