birkenfeld / serde-pickle

Rust (de)serialization for the Python pickle format.
Apache License 2.0
188 stars 28 forks source link

Update serde-pickle to work with serde 1.0. #4

Closed waymost closed 7 years ago

birkenfeld commented 7 years ago

Thanks for the patch! I was working on this as well, but hit an annoyance with respect to tuples/lists, see https://github.com/serde-rs/serde/issues/883#issuecomment-299778813. It seems that this is intentional, so I'll add a warning to the docs and merge this.

waymost commented 7 years ago

No problem! Regarding your comment in the serde issue you referenced, I think the problem in this instance is the difference in semantics stemming from the rust and python type systems.

You're right that it's a bit of a gotcha for b"12345" to convert to a python tuple not list. Fortunately, the fix is relatively simple as b"12345".to_vec() returns a Vec<u8>, which then results in a list on the python side.