En Thu, 12 Nov 2009 06:23:54 -0300, lallous escribió:
Everytime I use PyObject_SetAttrString(obj, attr_name, py_val) and I
don't need the reference to py_val I should decrement the reference
after this call?
If you own a reference to py_val, and you don't need it anymore, you must
decremen
On Nov 12, 9:23 am, "lallous" wrote:
> Hello,
>
> Everytime I use PyObject_SetAttrString(obj, attr_name, py_val) and I don't
> need the reference to py_val I should decrement the reference after this
> call?
Not necessarily: it depends where py_val came from. I find the
'ownership' model descri
Hello Daniel,
Thanks for the reply.
Everytime I use PyObject_SetAttrString(obj, attr_name, py_val) and I
don't
need the reference to py_val I should decrement the reference after this
call?
It really depends on /how/ the object is created. If the
method used to create *py_val* increases t
Hello,
Everytime I use PyObject_SetAttrString(obj, attr_name, py_val) and I don't
need the reference to py_val I should decrement the reference after this
call?
So for example:
PyObject *py_val = PyInt_FromLong(5)
PyObject_SetAttrString(py_obj, "val", py_val);
Py_DECREF(py_val)
Right?
If s