开发者

compatibility between CPython and IronPython cPickle

开发者 https://www.devze.com 2023-01-19 15:16 出处:网络
I was wondering whether objects serialized using CPython\'s cPickle are readable by using I开发者_开发知识库ronPython\'s cPickle; the objects in question do not require any modules outside of the buil

I was wondering whether objects serialized using CPython's cPickle are readable by using I开发者_开发知识库ronPython's cPickle; the objects in question do not require any modules outside of the built-ins that both Cpython and IronPython include. Thank you!


If you use the default protocol (0) which is text based, then things should work. I'm not sure what will happen if you use a higher protocol. It's very easy to test this ...


It will work because when you unpickle objects during load() it will use the current definitions of whatever classes you have defined now, not back when the objects were pickled.

IronPython is simply Python with the standard library implemented in C# so that everything emits IL. Both the CPython and the IronPython pickle modules have the same functionality, except one is implemented in C and the other in C#.

0

精彩评论

暂无评论...
验证码 换一张
取 消