birkenfeld / serde-pickle

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

Add support for builtin int #17

Closed jeroenbakker-atmind closed 3 years ago

jeroenbakker-atmind commented 3 years ago

Added support to deserialize an object that has been reduced to an int

When an object is reduced as an int the pickle contains a global int. This patch adds support for a global int.

def reduce_obj(ob):
    return (int, (id(ob), ))