
Victor Ng wrote:
I haven't been able to do much work on the lxml port as I've been swamped with work and my wrists were acting up (too much typing).
No problem; I'm intending to finish it if you can only give me a little bit of help. I'd like to preserve some of the lxml infrastructure that your branch throws out (the test runner and the makefile in particular). [breaking the circular import]
Is there any way to accomplish this? I understand that we need to subclass for weak-referencability, but is there any way to do this in .pyx code directly instead of in Python? Or could we make the weakreffable classes the root base class, so there's no need for them to inherit from vlibxml2_mod classes first, and then be used in vlibxml2_mod again?
You currently can't make Pyrex objects have weak references without doing the subclass thing. I don't think there is a circular import going on. I'll see if I can take a look at it later this week, but I'm pretty sure I won't. My fingers hurt.
Hm, no circular import, I wonder what I am doing in that case. One way to simplify this would be to have two very dummy base classes, and subclass them from Pyrex, if that's possible. That way the dummy base classes don't need to subclass from pyrex objects instead, which causes this odd cycle. I'll try to give the integration effort another try later this week. Perhaps I'll read the code in more detail and try to understand your memory management strategy better and extract just that out as a base. Good luck with your fingers! Thanks, Martijn