bpo-40077: Convert _elementtree types to heap types#23428
bpo-40077: Convert _elementtree types to heap types#23428erlend-aasland wants to merge 14 commits intopython:masterfrom
Conversation
|
@corona10 would you mind taking a look at this, when I've sorted out the CI failures? |
|
Tests are failing because subinterpreter re-initialized etree types. You either have to add an |
Ah, thanks, @tiran! I modified the |
9d7b90b to
5f584aa
Compare
|
This PR is stale because it has been open for 30 days with no activity. |
5f584aa to
9210a36
Compare
|
Ref. leaks are now fixed (commit 9210a36): Rebased onto master & force-pushed; hope that's ok. Ready for review, @tiran. |
|
FYI, all of these types follow the GC protocol, as described in bpo-42972. (cc. @vstinner @shihai1991) |
|
I dislike the temporary situation where we create new heap types but don't clear them at exit. Would it be possible to write a first PR to convert the _elementtree extension to multiphase init? And maybe also prepare the code for having per module types (having a module state)? (same PR or a different PR) For example, create a state which contains pointers to the static types, and ensure that static types are no longer referenced directly. |
I agree.
No problem. I'll create a new PR for multiphase init (bpo 1635741). If it's not too large a change, I'll include module state as well. |
I did some fiddling with this today, and the problem is that we've already got a (partial) module state, and it often uses
What do you think? |
https://bugs.python.org/issue40077