Serializing Objects
Learn about the concepts of serializing and deserializing and explore their implementation using the pickle module.
Serializing and deserializing
We’ve been working with bytes and file paths as foundations that support working with persistent objects. To make an object persistent, we need to create a series of bytes that represent the state of the object, and write those bytes to a file. The missing piece of persistence, then, is this process of encoding objects as a series of bytes. We also want to decode objects and their relationships from a series of bytes. This encoding and decoding is also described as serializing and deserializing.
Get hands-on with 1200+ tech skills courses.