[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

Eli Bendersky report at bugs.python.org
Tue Jan 1 01:32:50 CET 2013


Eli Bendersky added the comment:

A couple of high-level questions about the C code (this isn't a detailed review yet):

1. Why did you choose to implement __reduce__ and not __getstate__?
2. A lot of code appears to be shared between element_setstate_from_attributes and the init method implementation, can it be refactored?
3. I've been thinking about the C<->Python pickle compatibility, and it may be too much trouble at this point for no very strong benefit. What could make more sense at some point is implementing a __getstate__/__setstate__ in both the Python and C versions that are compatible (i.e. produce the same things). But this may mean changing the way the Python Element is pickled in 3.3, which may not be acceptable. So we may prefer to forego the compatibility in 3.3 and then for 3.4 make the change. I'm still not sure what is best here.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16076>
_______________________________________


More information about the Python-bugs-list mailing list