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

Toby tobia.conforto at linux.it
Mon Jan 9 00:26:21 CET 2006


Drirr wrote:
> Now I have another question. Is there something similar to __dealloc__
> but for the whole module? I want to do a cleanup once python decides
> the module's no longer needed (like at program exit).

This I don't know, but here's an (admittedly inelegant) idea:

	cdef class __AtExit:
	   def __dealloc__(self):
	       puts("exiting now...")

	__atexit = __AtExit()


Toby

-- 
Pascal is for building pyramids—imposing, breathtaking structures
built by armies pushing heavy blocks into place.
Lisp is for building organisms . . .		—Alan Perlis



More information about the Pyrex mailing list