From: fdrake at cnri.reston.va.us (Fred L. Drake)
Date: Tue, 20 Apr 1999 13:18:38 GMT
Subject: Can't work this XDR out
In-Reply-To: <371C0CF7.2D1260D7@hons.cs.usyd.edu.au>
References: <371C0CF7.2D1260D7@hons.cs.usyd.edu.au>
Message-ID: <14108.32430.842541.785124@weyr.cnri.reston.va.us>
X-UID: 34                                                  

Matthew Robert Gallagher writes:
 > Whilst trying to pack a list xdr packer asks for
 > 
 > (list, pack_item)
 > 
 > what is the pack_item can't work this out as there are no examples

Matthew,
  pack_item will typically be another method from the same packer
object.  For example, to pack a list of ints, use this:

	import xdrlib
	p = xdrlib.Packer()
	p.pack_list([1, 2, 3], p.pack_int)

  I hope this helps.  I'll add an example to the documentation.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake at acm.org>
Corporation for National Research Initiatives




