You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer I want to know why I can't call store.set('foo', bytes_object) -- why do I have to import this Buffer class, then create a buffer from my bytes? I.e., why doesn't store.set take BytesLike?
The Buffer ABC defines 2 class methods for creating buffers from non-buffers: from_bytes and from_array_like. Therefore every Buffer class can turn BytesLike or ArrayLike instances into instances of that class, and so store.set(key, bytes) could just get the default buffer prototype and create the buffer it needs from the byteslike / arraylike provided to set.
So is there any reason why we shouldn't support this new function signature for Store.set?
In main
Store.set
has the following signature:zarr-python/src/zarr/abc/store.py
Line 256 in 498cb78
As a developer I want to know why I can't call
store.set('foo', bytes_object)
-- why do I have to import thisBuffer
class, then create a buffer from my bytes? I.e., why doesn'tstore.set
takeBytesLike
?The
Buffer
ABC defines 2 class methods for creating buffers from non-buffers:from_bytes
andfrom_array_like
. Therefore everyBuffer
class can turnBytesLike
orArrayLike
instances into instances of that class, and sostore.set(key, bytes)
could just get the default buffer prototype and create the buffer it needs from the byteslike / arraylike provided toset
.So is there any reason why we shouldn't support this new function signature for
Store.set
?The text was updated successfully, but these errors were encountered: