-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
add single-argument (de)serialize methods operating on vectors of bytes #60315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Looks good. Would be nice to add doc strings to these. |
LilithHafner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I've also wanted this functionality. There's no other plausible implementation of the deserialize(::Vector{UInt8}) method, and the return type Vector{UInt8} seems reasonable for the serialize(value) method.
Should go to triage as it is technically an expansion of public API? The specific question I'd ask is: "Is Vector{UInt8} the right return type for serialize(value)?"
|
I think we can just merge this. What is the mac build failure here about? |
|
is there a reason the docs enforce specifically a for |
| See [`deserialize(::IO)`](@ref deserialize(::IO)) for more details and caveats. | ||
| !!! compat "Julia 1.13" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| !!! compat "Julia 1.13" | |
| !!! compat "Julia 1.14" |
| See [`deserialize(::IO)`](@ref deserialize(::IO)) for more details and caveats. | ||
| !!! compat "Julia 1.13" | ||
| This method is available as of Julia 1.13. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This method is available as of Julia 1.13. | |
| This method is available as of Julia 1.14. |
Basically, for convenience: I find myself copy-pasting these methods whenever I load/store Julia serialized data as part of another data format like parquet or sql database. They natively store byte arrays, and would be nice to have these (de)serialize methods going directly back and forth between Julia objects and byte vectors.
Another neat usecase is to quickly copy-paste a Julia object between different Julia sessions (repls, notebooks, remote, ...):