diff options
author | Guido van Rossum <guido@python.org> | 1996-06-26 20:20:57 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-06-26 20:20:57 (GMT) |
commit | bbb1e26a67bb1abfdc9ffeaf0a1f331507a0594a (patch) | |
tree | 572239585e46951e1c44a03f007f2d1edf87351d /Doc/lib/libmarshal.tex | |
parent | f2e98b4f5555c29e55ee7ddebfdb5cdf621f68b2 (diff) | |
download | cpython-bbb1e26a67bb1abfdc9ffeaf0a1f331507a0594a.zip cpython-bbb1e26a67bb1abfdc9ffeaf0a1f331507a0594a.tar.gz cpython-bbb1e26a67bb1abfdc9ffeaf0a1f331507a0594a.tar.bz2 |
Add docs for planned improved handling of the marshalling of
unmarshallable objects.
Diffstat (limited to 'Doc/lib/libmarshal.tex')
-rw-r--r-- | Doc/lib/libmarshal.tex | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Doc/lib/libmarshal.tex b/Doc/lib/libmarshal.tex index 3abcc42..58becdb 100644 --- a/Doc/lib/libmarshal.tex +++ b/Doc/lib/libmarshal.tex @@ -61,19 +61,27 @@ The module defines these functions: \code{sys.stdout} or returned by \code{open()} or \code{posix.popen()}. - If the value has an unsupported type, garbage is written which cannot - be read back by \code{load()}. + 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 by + \code{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. + + Warning: If an object containing an unsupported type was marshalled + with \code{dump()}, \code{load()} will substitute \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. \end{funcdesc} \begin{funcdesc}{loads}{string} |