[XML-SIG] WDDX for Python

Fred L. Drake Fred L. Drake, Jr." <fdrake@acm.org
Thu, 17 Dec 1998 18:10:16 -0500 (EST)


Paul Prescod writes:
 > According to the Pickle documentation, no C built-ins can be pickled
 > except the most basic types. I'm surprised that there isn't any way to
 > make user-defined built-in types (e.g. a C-programmed DOM-node) picklable.

Hey Paul!
  You can use the copy_reg module to register pickling operations on
built-in types that aren't already picklable.  To see how do this from
C, look at Modules/parsermodule.c.

 > This is a problem I have been discussing in the newsgroup. We would have
 > to define a WDDX time object and Python programmers could convert
 > seconds-past-the-epoch integers or time tuple-lists to time objects:
 > wddx.time( time.gmtime()). It would be nicer to have 1.5.2 contain some

  I've not had time to keep up with the newsgroup / list, but agree we 
need this.  I've thought a little about this for the iso8601 module;
I'd like a class that can represent dates that are "not precise", like
"december, 1998".  The ISO 8601 standard includes such things, and
being able to represent them is useful.  (I've not had time to look at 
mxDateTime yet.)

 > want to force the programmer to convert every item in a list (e.g.) to a
 > WDDX type. That would be onerous.

  Support for a commonly used type (mxDataTime stuff?) might be the
best way, and provide a type for people without that extension.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake@acm.org>
Corporation for National Research Initiatives
1895 Preston White Dr.	    Reston, VA  20191