[Pyrex] __dealloc__ (was: Problems with pyrex and glib)

Lenard Lindstrom len-l at telus.net
Mon Jan 9 20:14:31 CET 2006


On 9 Jan 2006 at 10:26, Simon Burton wrote:

> On Sun, 08 Jan 2006 17:13:00 -0600
> Drirr <miston.drirr at gmail.com> wrote:
> 
> > 
> > Now I have another question. Is there something similar to __dealloc__ 
> > but for the whole module?
> 
> Use the __del__ method of a global singleton object.
> 

The singleton would have to be of a new style class, not an extension 
type, for __del__ to work. It also has to be assigned to a python 
variable. Also note that there is no good way to control when the 
__del__ method is called during the deallocation of the globals.

Lenard Lindstrom
<len-l at telus.net>




More information about the Pyrex mailing list