There are currently 4 different protocols which can be used for
pickling.
Protocol version 0 is the original human-readable protocol and is backwards compatible with earlier versions of Python.
Protocol version 1 is the old binary format which is also compatible with earlier versions of Python.
Protocol version 2 was introduced in Python 2.3. It provides much more efficient pickling of new-style classes.
Protocol version 3 was added in Python 3.0. It has explicit support for bytes and cannot be unpickled by Python 2.x pickle modules. This
is the current recommended protocol, use it whenever it is possible.
就像这样:
编辑
我认为依靠最新的文件是安全的。例如pickle documentation for Python 3.2.1状态:
我想这很容易确认!
为了明确回答您的问题,这意味着Python 2.6-2.7支持Pickle版本<;=2.0,Python 3.0-3.2支持Pickle版本<;=3.0。
相关问题 更多 >
编程相关推荐