New iteration.
Open issues:
- Share code with the init method. The issue with sharing code with either element_init() or create_new_element() would be malloc+realloc: unlike either of these methods, we know both the attributes and the number of children at allocation time, so we can allocate directly the right number of children.
- C<->Py Interchangeable pickling of TreeBuilder (per above msg).
Differences to previous version:
- Skip C<->Py interchangeability testing of TreeBuilder --- because that one started failing with:
_pickle.UnpicklingError: state is not a dictionary
It can probably be fixed, but I'd like to address the above question about pickling the factory first.
- Use __getstate__ rather than __reduce__ for Element.
- Make Element pickling interchangeable between c/py Element
(set tp_name to "xml.etree.ElementTree.Element" and match the
pickled format).