oop in python object serialization in the context of data storageserialization is the process of translating data structures or object state into format that can be stored (for examplein file or memory bufferor transmitted and reconstructed later in serializationan object is transformed into format that can be storedso as to be able to deserialize it later and recreate the original object from the serialized format pickle pickling is the process whereby python object hierarchy is converted into byte stream (usually not human readableto be written to filethis is also known as serialization unpickling is the reverse operationwhereby byte stream is converted back into working python object hierarchy pickle is operationally simplest way to store the object the python pickle module is an object-oriented way to store objects directly in special storage format what can it dopickle can store and reproduce dictionaries and lists very easily stores object attributes and restores them back to the same state what pickle can' doit does not save an objects code only it' attributes values it cannot store file handles or connection sockets in short we can saypickling is way to store and retrieve data variables into and out from files where variables can be listsclassesetc to pickle something you mustimport pickle write variable to filesomething like pickle dump(mystringoutfileprotocol)where rd argument protocol is optional to unpickling something you mustimport pickle write variable to filesomething like mystring pickle load(inputfile