10.7 Serialization
10.7 Serialization
FILES 76
10.7 Serialization
Serialization (pickling) allows you to save non-textual information to
memory or transmit it over a network. Pickling essentially takes any
data object, such as dictionaries, lists, or even class instances (which
we’ll cover later), and converts it into a byte set that can be used to
“reconstitute” the original data.
Statements
Now that we know how Python uses it’s fundamental data types, let’s
talk about how to use them. Python is nominally a procedure-based
language but as we’ll see later, it also functions as an object-oriented
language. As a matter of fact, it’s similar to C++ in this aspect; you
can use it as either a procedural or OO language or combine them as
necessary.
The following is a listing of many Python statements. It’s not
all-inclusive but it gives you an idea of some of the features Python
has.
78
CHAPTER 11. STATEMENTS 79
11.1 Assignment
I’ve already talked about assignment before. To reiterate, assignment
is basically putting the target name on the left of an equals sign and
the object you’re assigning to it on the right. There’s only a few things
you need to remember:
• Assignment creates object references.