Re: [Python-Dev] Class destructor
"Phillip J. Eby"
Well, you could use a custom metaclass with a tp_dealloc or whatever.
Yes, I thought of that, but a custom metaclass to provide one callback is pretty fair overkill!
But I just mainly meant that a PyCObject is almost as good as a weakref for certain purposes -- i.e. it's got a pointer and a callback.
Ah. Yes. Thanks for suggesting it - if it is the simplest way, I may as well do it.
You could of course also use weak references, but that's a bit more awkward as well.
Yes. And they aren't a technology I have used (in Python), so I would have to find out about them. Attributes etc. I have already played with. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: nmm1@cam.ac.uk Tel.: +44 1223 334761 Fax: +44 1223 334679
participants (1)
-
Nick Maclaren