This repository was archived by the owner on Aug 11, 2021. It is now read-only.
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
Passing in codecs instead of identifiers #197
Open
Description
The current API takes multicodec codes as parameter for formats. @Gozala proposes #191 (comment) to pass in codec instances:
I find passing name / code of the codec counter intuitive & I think just providing a codec instance might be better for following reasons:
- Type checkers / linters can catch mismatching / invalid references, but are useless with names.
- If codec has not being installed you get an error, while with say
dag.put(node, dag.codec[name])
you are encourage to see if format is known.- Don't necessarily need to install codec to use it.
I understand that without installing a codec / format
decode
will not work, howeverget
could optionally take codec as well. In case ofputMany / getMany
it's less clear but maybe optional codec dict can be provided as in{[name]:Codec}
.Not a big deal, just in my code I find it more convenient to pass actual codecs than names.
Metadata
Metadata
Assignees
Labels
No labels