From: Fred Drake Date: Tue, 20 Apr 1999 13:41:14 +0000 (+0000) Subject: Added example use of pack_list() to help explain the pack_item X-Git-Tag: v1.6a1~1577 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad56dafd62baf60d6be28481154d1a69bb966ca3;p=thirdparty%2FPython%2Fcpython.git Added example use of pack_list() to help explain the pack_item parameter. Lack of clarity reported by Matthew Gallagher . --- diff --git a/Doc/lib/libxdrlib.tex b/Doc/lib/libxdrlib.tex index 3565eb77de40..57329d7994c9 100644 --- a/Doc/lib/libxdrlib.tex +++ b/Doc/lib/libxdrlib.tex @@ -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 the individual item. At the end of the list, an unsigned integer \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} \begin{methoddesc}[Packer]{pack_farray}{n, array, pack_item}