Skip to content
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

Added support for builtin list. #16

Conversation

jeroenbakker-atmind
Copy link

@jeroenbakker-atmind jeroenbakker-atmind commented Sep 2, 2021

Reset memoize to support streaming multiple objects.

By default (value_)from_reader closes the input stream. It is possible
to deserialize multiple pickle objects from a single stream by
implementing a custom reader.

This patch will reset the memoize at the beginning when a new object is
deserialized. Any refs would then point to the correct object inside the memoize.

We checked several approaches but this approach seems to fit best (support most
protocols) however this might not be the obvious place.

Copy link
Owner

@birkenfeld birkenfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a minor nit that I'll fix post merge.

self.stack.push(Value::List(items));
Ok(())
}
_ => self.error(ErrorCode::InvalidValue("set() arg".into())),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be list() arg I think.

@birkenfeld
Copy link
Owner

Nightly failure is due to rust-num/num-bigint#218

@birkenfeld birkenfeld merged commit b26d46f into birkenfeld:master Sep 3, 2021
@birkenfeld
Copy link
Owner

Thanks for the PR! I've released 0.6.3 with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants