Archive

Posts Tagged ‘serialization’

Serialization in Python

October 7th, 2007 2 comments

We begin this tutorial quoting from Wikipedia:

In computer science, in the context of data storage and transmission, serialization is the process of saving an object onto a storage medium (such as a file, or a memory buffer) or to transmit it across a network connection link in binary form. The series of bytes or the format can be used to re-create an object that is identical in its internal state to the original object (actually a clone).

This process of serializing an object is also called deflating or marshalling an object. The opposite operation, extracting a data structure from a series of bytes, is deserialization (which is also called inflating or unmarshalling).

So serialization is useful when we have to store a complex data structure. For example it could be useful if you have to store into a cookie users information. If we have an object “user” composed by username,password etc… we can serialize it and so we can use a single cookie.

Read more…