* Martin v. Loewis, on 08.07.2010 07:23:
And since things work for a single method when I declare 'def' as
'static', I suspect that means that the function object created by
PyCFunction_NewEx holds on to a pointer to the PyMethodDef structure?
Correct; it doesn't make a copy of the struct. So
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
* Martin v. Loewis, on 08.07.2010 09:13:
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
The code below, very much work in progress, just trying things, is C++.
Sorry about the formatting, I had to reformat manually for this posting:
code
class Module
{
private:
Ptr p_;
public:
Module( PyModuleDef const def )
: p_(
And since things work for a single method when I declare 'def' as
'static', I suspect that means that the function object created by
PyCFunction_NewEx holds on to a pointer to the PyMethodDef structure?
Correct; it doesn't make a copy of the struct. So when you want the
function object to