Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
03b75fa4
Commit
03b75fa4
authored
May 31, 2007
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some spaces in the example code.
parent
7eec2179
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Doc/lib/libpickle.tex
Doc/lib/libpickle.tex
+3
-3
No files found.
Doc/lib/libpickle.tex
View file @
03b75fa4
...
...
@@ -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}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment