summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-05-31 04:14:22 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-05-31 04:14:22 (GMT)
commit03b75fa4e1331d4c9f5ff6385ff54fb522bc4cab (patch)
tree9c8028d8c84d850d42d482f01719d404d78695d4 /Doc
parent7eec2179081c86e1a79c5f17b43346e14fc8fb53 (diff)
downloadcpython-03b75fa4e1331d4c9f5ff6385ff54fb522bc4cab.zip
cpython-03b75fa4e1331d4c9f5ff6385ff54fb522bc4cab.tar.gz
cpython-03b75fa4e1331d4c9f5ff6385ff54fb522bc4cab.tar.bz2
Add some spaces in the example code.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libpickle.tex6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/lib/libpickle.tex b/Doc/lib/libpickle.tex
index 3290641..0c4cd98 100644
--- a/Doc/lib/libpickle.tex
+++ b/Doc/lib/libpickle.tex
@@ -799,7 +799,7 @@ class TextReader:
del odict['fh'] # remove filehandle entry
return odict
- def __setstate__(self,dict):
+ def __setstate__(self, dict):
fh = open(dict['file']) # reopen file
count = dict['lineno'] # read from file...
while count: # until line count is restored
@@ -820,7 +820,7 @@ A sample usage might be something like this:
... obj.readline()
'7: class TextReader:'
>>> import pickle
->>> pickle.dump(obj,open('save.p','w'))
+>>> pickle.dump(obj,open('save.p', 'wb'))
\end{verbatim}
If you want to see that \refmodule{pickle} works across Python
@@ -829,7 +829,7 @@ follows can happen from either the same process or a new process.
\begin{verbatim}
>>> import pickle
->>> reader = pickle.load(open('save.p'))
+>>> reader = pickle.load(open('save.p', 'rb'))
>>> reader.readline()
'8: "Print and number lines in a text file."'
\end{verbatim}