How do I add method dynamically to module using C API?

Martin v. Loewis martin at v.loewis.de
Thu Jul 8 03:13:50 EDT 2010


> I tried (1) adding a __del__, but no dice, I guess
> because it wasn't really an object method but just a free function in a
> module; and (2) the m_free callback in the module definition structure,
> but it was not called.

m_free will be called if the module object gets deallocated. So if
m_free really isn't called, the module got never deallocated.

Regards,
Martin



More information about the Python-list mailing list