PyXML pickle problem with PyXML0.8.1

Martin v. Löwis loewis at informatik.hu-berlin.de
Mon Nov 4 12:57:43 EST 2002


Jacob Smullyan <smulloni at bracknell.smullyan.org> writes:

> I recklessly upgraded to PyXML 0.8.1 and found that
> xml.dom.minidom.Document instances are now no longer pickleable,
> because they define __slots__ without defining __getstate__.  Other
> classes in minidom do support pickling, but not Document.  Is there a
> reason for this? 

For what specifically? For defining __slots__? Performance, in
particular by saving the memory for the additional dictionary.  For
not including __getstate__? No, that's a bug.

Notice that Document specifically does *not* define __slots__. Most
likely, you ran into an instance of NamedNodeMap.

> I think this is just a bug, best recorded on PyXML's bug tracker, but
> in case someone wants to argue that it isn't, I thought I'd give them
> an opportunity.  

It's certainly a bug - although a patch would be appreciated over a
bug report :-) If possible, arrange it so that it will have a
__getattr__ only in Python 2.2 and newer, by coming up with some magic
in minicompat.

Regards,
Martin



More information about the Python-list mailing list