Protocol Formats of pickle
Currently, there are six different protocols for
pickle. These protocols are tied to the Python interpreter version that you’re using. Going through the list, the big versions are 2.3, 3.0, 3.4, and 3.8.
The big thing to consider is that newer protocols require a newer interpreter to process. So if you were to pickle something using protocol version 5, which is the current latest version, you would need to use at least version 3.8 to work with it. If you had anything earlier, you’d have errors trying to unpickle it. Also to keep in mind is that the highest available level protocol will be used unless you define a specific protocol using the
protocol=parameter when you call one of the
The different protocols of
pickle aren’t too important for what we’re doing with them right now, but can be important to keep in mind if you’re working on a project that needs to work with many different versions of Python. All right!
Become a Member to join the conversation.