Protocol Formats of pickle
00:00
In this lesson, you’re going to learn what the protocol formats of the Python pickle
module are. Over time, the pickle
module has evolved to add more features and improve performance.
00:12
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.
00:27
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 pickle
methods.
00:59
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!
01:13 In the next lesson, you’re going to see some unpickleable data types and a solution to handle these cases.
Become a Member to join the conversation.