dumps() – This function is called to serialize an object hierarchy. loads() – This function is called to de-serialize a data stream.
How do you serialize a hierarchy of objects?
Pickle. Pickling is the process whereby a Python object hierarchy is converted into a byte stream (usually not human readable) to be written to a file, this is also known as Serialization. Unpickling is the reverse operation, whereby a byte stream is converted back into a working Python object hierarchy.
Which of the following modules has functions for object serialization?
The 'json' module in Python's standard library defines functions for object serialization. Just as in pickle module, the json module also provides dumps() and loads() function for serialization of Python object into JSON encoded string.