En Fri, 29 Jan 2010 19:50:52 -0300, Mr.M <m...@unknown.nospam> escribió:

I can't figure out if there is a way to run a specialized cleanup function when a module needs to be "unloaded" (i.e. just before a reload() or when i quit the interpreter).

I think what you want to do isn't possible with Python 2, and it's one of the reasons the module handling was redesigned in Python 3.x; see PEP 3121.

I'm thinking of something like tp_dealloc.

m_free (PyModuleDef member, in Python 3) might work for this.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to