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
7506298d
Commit
7506298d
authored
Feb 16, 1998
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark up filename extensions consistently.
Logical markup.
parent
3b26eedd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
42 deletions
+42
-42
Doc/lib/libmarshal.tex
Doc/lib/libmarshal.tex
+21
-21
Doc/libmarshal.tex
Doc/libmarshal.tex
+21
-21
No files found.
Doc/lib/libmarshal.tex
View file @
7506298d
...
...
@@ -17,9 +17,9 @@ internal to external form (in an RPC buffer for instance) and
This is not a general ``persistency'' module. For general persistency
and transfer of Python objects through RPC calls, see the modules
\
code
{
pickle
}
and
\code
{
shelve
}
. The
\cod
e
{
marshal
}
module exists
\
module
{
pickle
}
and
\module
{
shelve
}
. The
\modul
e
{
marshal
}
module exists
mainly to support reading and writing the ``pseudo-compiled'' code for
Python modules of
\
samp
{
.pyc
}
files.
Python modules of
\
file
{
.pyc
}
files.
\refstmodindex
{
pickle
}
\refstmodindex
{
shelve
}
\obindex
{
code
}
...
...
@@ -37,16 +37,16 @@ supported; and recursive lists and dictionaries should not be written
\strong
{
Caveat:
}
On machines where C's
\code
{
long int
}
type has more than
32 bits (such as the DEC Alpha), it
is possible to create plain Python integers that are longer than 32
bits. Since the current
\
cod
e
{
marshal
}
module uses 32 bits to
bits. Since the current
\
modul
e
{
marshal
}
module uses 32 bits to
transfer plain Python integers, such values are silently truncated.
This particularly affects the use of very long integer literals in
Python modules --- these will be accepted by the parser on such
machines, but will be silently be truncated when the module is read
from the
\
cod
e
{
.pyc
}
instead.
%
from the
\
fil
e
{
.pyc
}
instead.
%
\footnote
{
A solution would be to refuse such literals in the parser,
since they are inherently non-portable. Another solution would be to
let the
\
code
{
marshal
}
module raise an exception when an integer value
would be truncated. At least one of these solutions will be
let the
\
module
{
marshal
}
module raise an exception when an integer
value
would be truncated. At least one of these solutions will be
implemented in a future version.
}
There are functions that read/write files as well as functions
...
...
@@ -59,34 +59,34 @@ The module defines these functions:
\begin{funcdesc}
{
dump
}{
value
\,
file
}
Write the value on the open file. The value must be a supported
type. The file must be an open file object such as
\code
{
sys.stdout
}
or returned by
\
code
{
open()
}
or
\
code
{
posix.popen()
}
.
\code
{
sys.stdout
}
or returned by
\
function
{
open()
}
or
\
function
{
posix.popen()
}
.
If the value has (or contains an object that has) an unsupported type,
a
\
code
{
ValueError
}
exception is raised -- but garbage data will also
be written to the file. The object will not be properly read back b
y
\code
{
load()
}
.
a
\
exception
{
ValueError
}
exception is raised -- but garbage data
will also be written to the file. The object will not be properl
y
read back by
\function
{
load()
}
.
\end{funcdesc}
\begin{funcdesc}
{
load
}{
file
}
Read one value from the open file and return it. If no valid value
is read, raise
\
code
{
EOFError
}
,
\code
{
ValueError
}
or
\
code
{
TypeError
}
. The file must be an open file object.
is read, raise
\
exception
{
EOFError
}
,
\exception
{
ValueError
}
or
\
exception
{
TypeError
}
. The file must be an open file object.
Warning: If an object containing an unsupported type was marshalled
with
\
code
{
dump()
}
,
\code
{
load()
}
will substitute
\code
{
None
}
for th
e
unmarshallable type.
with
\
function
{
dump()
}
,
\function
{
load()
}
will substitut
e
\code
{
None
}
for the
unmarshallable type.
\end{funcdesc}
\begin{funcdesc}
{
dumps
}{
value
}
Return the string that would be written to a file by
\code
{
dump(
value, file)
}
. The value must be a supported type.
Raise a
\code
{
ValueError
}
exception if value has (or contains an
object that has) an unsupported type.
\code
{
dump(
\var
{
value
}
,
\var
{
file
}
)
}
. The value must be a supported
type. Raise a
\exception
{
ValueError
}
exception if value has (or
contains an
object that has) an unsupported type.
\end{funcdesc}
\begin{funcdesc}
{
loads
}{
string
}
Convert the string to a value. If no valid value is found, raise
\
code
{
EOFError
}
,
\code
{
ValueError
}
or
\code
{
TypeError
}
. Extra
characters in the string are ignored.
\
exception
{
EOFError
}
,
\exception
{
ValueError
}
or
\exception
{
TypeError
}
. Extra
characters in the string are ignored.
\end{funcdesc}
Doc/libmarshal.tex
View file @
7506298d
...
...
@@ -17,9 +17,9 @@ internal to external form (in an RPC buffer for instance) and
This is not a general ``persistency'' module. For general persistency
and transfer of Python objects through RPC calls, see the modules
\
code
{
pickle
}
and
\code
{
shelve
}
. The
\cod
e
{
marshal
}
module exists
\
module
{
pickle
}
and
\module
{
shelve
}
. The
\modul
e
{
marshal
}
module exists
mainly to support reading and writing the ``pseudo-compiled'' code for
Python modules of
\
samp
{
.pyc
}
files.
Python modules of
\
file
{
.pyc
}
files.
\refstmodindex
{
pickle
}
\refstmodindex
{
shelve
}
\obindex
{
code
}
...
...
@@ -37,16 +37,16 @@ supported; and recursive lists and dictionaries should not be written
\strong
{
Caveat:
}
On machines where C's
\code
{
long int
}
type has more than
32 bits (such as the DEC Alpha), it
is possible to create plain Python integers that are longer than 32
bits. Since the current
\
cod
e
{
marshal
}
module uses 32 bits to
bits. Since the current
\
modul
e
{
marshal
}
module uses 32 bits to
transfer plain Python integers, such values are silently truncated.
This particularly affects the use of very long integer literals in
Python modules --- these will be accepted by the parser on such
machines, but will be silently be truncated when the module is read
from the
\
cod
e
{
.pyc
}
instead.
%
from the
\
fil
e
{
.pyc
}
instead.
%
\footnote
{
A solution would be to refuse such literals in the parser,
since they are inherently non-portable. Another solution would be to
let the
\
code
{
marshal
}
module raise an exception when an integer value
would be truncated. At least one of these solutions will be
let the
\
module
{
marshal
}
module raise an exception when an integer
value
would be truncated. At least one of these solutions will be
implemented in a future version.
}
There are functions that read/write files as well as functions
...
...
@@ -59,34 +59,34 @@ The module defines these functions:
\begin{funcdesc}
{
dump
}{
value
\,
file
}
Write the value on the open file. The value must be a supported
type. The file must be an open file object such as
\code
{
sys.stdout
}
or returned by
\
code
{
open()
}
or
\
code
{
posix.popen()
}
.
\code
{
sys.stdout
}
or returned by
\
function
{
open()
}
or
\
function
{
posix.popen()
}
.
If the value has (or contains an object that has) an unsupported type,
a
\
code
{
ValueError
}
exception is raised -- but garbage data will also
be written to the file. The object will not be properly read back b
y
\code
{
load()
}
.
a
\
exception
{
ValueError
}
exception is raised -- but garbage data
will also be written to the file. The object will not be properl
y
read back by
\function
{
load()
}
.
\end{funcdesc}
\begin{funcdesc}
{
load
}{
file
}
Read one value from the open file and return it. If no valid value
is read, raise
\
code
{
EOFError
}
,
\code
{
ValueError
}
or
\
code
{
TypeError
}
. The file must be an open file object.
is read, raise
\
exception
{
EOFError
}
,
\exception
{
ValueError
}
or
\
exception
{
TypeError
}
. The file must be an open file object.
Warning: If an object containing an unsupported type was marshalled
with
\
code
{
dump()
}
,
\code
{
load()
}
will substitute
\code
{
None
}
for th
e
unmarshallable type.
with
\
function
{
dump()
}
,
\function
{
load()
}
will substitut
e
\code
{
None
}
for the
unmarshallable type.
\end{funcdesc}
\begin{funcdesc}
{
dumps
}{
value
}
Return the string that would be written to a file by
\code
{
dump(
value, file)
}
. The value must be a supported type.
Raise a
\code
{
ValueError
}
exception if value has (or contains an
object that has) an unsupported type.
\code
{
dump(
\var
{
value
}
,
\var
{
file
}
)
}
. The value must be a supported
type. Raise a
\exception
{
ValueError
}
exception if value has (or
contains an
object that has) an unsupported type.
\end{funcdesc}
\begin{funcdesc}
{
loads
}{
string
}
Convert the string to a value. If no valid value is found, raise
\
code
{
EOFError
}
,
\code
{
ValueError
}
or
\code
{
TypeError
}
. Extra
characters in the string are ignored.
\
exception
{
EOFError
}
,
\exception
{
ValueError
}
or
\exception
{
TypeError
}
. Extra
characters in the string are ignored.
\end{funcdesc}
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