Commit ad56dafd authored by Fred Drake's avatar Fred Drake

Added example use of pack_list() to help explain the pack_item

parameter.  Lack of clarity reported by Matthew Gallagher
<hew@hons.cs.usyd.edu.au>.
parent 068d5724
...@@ -95,6 +95,15 @@ unsigned integer \code{1} is packed first, followed by the data value ...@@ -95,6 +95,15 @@ unsigned integer \code{1} is packed first, followed by the data value
from the list. \var{pack_item} is the function that is called to pack from the list. \var{pack_item} is the function that is called to pack
the individual item. At the end of the list, an unsigned integer the individual item. At the end of the list, an unsigned integer
\code{0} is packed. \code{0} is packed.
For example, to pack a list of integers, the code might appear like
this:
\begin{verbatim}
import xdrlib
p = xdrlib.Packer()
p.pack_list([1, 2, 3], p.pack_int)
\end{verbatim}
\end{methoddesc} \end{methoddesc}
\begin{methoddesc}[Packer]{pack_farray}{n, array, pack_item} \begin{methoddesc}[Packer]{pack_farray}{n, array, pack_item}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment