[Python-Dev] folding cElementTree behind ElementTree in 3.3 (original) (raw)

Eli Bendersky eliben at gmail.com
Sun Feb 26 11:45:30 CET 2012


It probably wouldn't be very difficult to make elementnew() the tpnew of ElementType, and expose that type as "Element". That would settle the issue nicely and avoid compatibility concerns :)

Regards

I guess it's not as simple as that. element_new doesn't quite have the signature required for tp_new. Besides, a constructor would also be needed (since a subclass may be interested in calling Element.init) and there's no natural function to serve as the constructor.

I've opened issue 14128 to track this. I plan to implement a standard tp_new and tp_init functions for Element to expose it as a class from the module. element_new also happens to be used internally - I'll try to refactor to avoid code duplication as much as possible.

Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20120226/b7dd7bc8/attachment.html>



More information about the Python-Dev mailing list