From 30a22301582cf01cc018c5324f06a5785e9b0571 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Thu, 27 Aug 2009 15:19:04 -0400 Subject: [PATCH] identical --> equal --- serializing.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serializing.html b/serializing.html index 51449e6..036f21d 100644 --- a/serializing.html +++ b/serializing.html @@ -138,7 +138,7 @@ NameError: name 'entry' is not defined
  • Now the entry variable is a dictionary with familiar-looking keys and values. -

    The pickle.dump() / pickle.load() cycle results in an identical copy of the original data structure. +

    The pickle.dump() / pickle.load() cycle results in a new data structure that is equal to the original data structure.

     >>> shell                                    
    @@ -156,7 +156,7 @@ NameError: name 'entry' is not defined
     
  • Switch back to Python Shell #1.
  • Open the entry.pickle file.
  • Load the serialized data into a new variable, entry2. -
  • Python confirms that the two dictionaries, entry and entry2, are identical. In this shell, you built entry from the ground up, starting with an empty dictionary and manually assigning values to specific keys. You serialized this dictionary and stored it in the entry.pickle file. Now you’ve read the serialized data from that file and created a perfect replica of the original data structure. +
  • Python confirms that the two dictionaries, entry and entry2, are equal. In this shell, you built entry from the ground up, starting with an empty dictionary and manually assigning values to specific keys. You serialized this dictionary and stored it in the entry.pickle file. Now you’ve read the serialized data from that file and created a perfect replica of the original data structure.
  • For reasons that will become clear later in this chapter, I want to point out that the value of the 'tags' key is a tuple, and the value of the 'internal_id' key is a bytes object.