(original) (raw)
It probably wouldn't be very difficult to make element\_new() the tp\_new
of Element\_Type, 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