Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb52df6

Browse files
author
Mark Pilgrim
committed
typo
1 parent f6835fe commit fb52df6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

serializing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ <h2 id=debugging>Debugging Pickle Files</h2>
280280
357: . STOP
281281
<mark>highest protocol among opcodes = 3</mark></samp></pre>
282282

283-
<p>The most interesting piece of information in that disassembly is on the last line, because it includes the version of the pickle protocol with which this file was saved. There is no explicit version marker in the pickle protocol. To determine which protocol version was used to store a pickle file, you need to look at the markers (&#8220;opcodes&#8221;) within the pickled data and use hard-coded knowledge of which opcodes were introduced with each version of the pickle protocol. The <code>pickle.dis()</code> function does exactly that, and it prints the result in the last line of the disassembly output. Here is a function that returns just the version number, without printing anything:
283+
<p>The most interesting piece of information in that disassembly is on the last line, because it includes the version of the pickle protocol with which this file was saved. There is no explicit version marker in the pickle protocol. To determine which protocol version was used to store a pickle file, you need to look at the markers (&#8220;opcodes&#8221;) within the pickled data and use hard-coded knowledge of which opcodes were introduced with each version of the pickle protocol. The <code>pickletools.dis()</code> function does exactly that, and it prints the result in the last line of the disassembly output. Here is a function that returns just the version number, without printing anything:
284284

285285
<p class=d>[<a href=examples/pickleversion.py>download <code>pickleversion.py</code></a>]
286286
<pre class=pp><code>import pickletools

0 commit comments

Comments
 (0)