Re: [Python-Dev] Py_BuildValue and decref

2006-09-11 Thread Greg Ewing
Mihai Ibanescu wrote: > Given that it doesn't seem to be the case, and my quick look at the code > indicates that even internally python is inconsistent, should I file a > low-severity bug so we don't lose track of this? I'd say so, yes. A function whose refcount behaviour differs when it fails i

Re: [Python-Dev] Py_BuildValue and decref

2006-09-11 Thread Mihai Ibanescu
On Sun, Sep 10, 2006 at 07:35:59PM +1200, Greg Ewing wrote: > Barry Warsaw wrote: > > I just want to point out that the C API documentation is pretty > > silent about the refcounting side-effects in error conditions (and > > often in success conditions too) of most Python functions. For > >

Re: [Python-Dev] Py_BuildValue and decref

2006-09-10 Thread Greg Ewing
Barry Warsaw wrote: > I just want to point out that the C API documentation is pretty > silent about the refcounting side-effects in error conditions (and > often in success conditions too) of most Python functions. For > example, what is the refcounting side-effects of PyDict_SetItem() on

Re: [Python-Dev] Py_BuildValue and decref

2006-09-08 Thread Mihai Ibanescu
On Fri, Sep 08, 2006 at 06:27:08PM -0400, Barry Warsaw wrote: > > On Sep 8, 2006, at 6:06 PM, Mihai Ibanescu wrote: > > >There is no description of what happens when Py_BuildValue fails. > >Will it > >decref the python object passed in? Will it not? > > I just want to point out that the C API

Re: [Python-Dev] Py_BuildValue and decref

2006-09-08 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sep 8, 2006, at 6:06 PM, Mihai Ibanescu wrote: > There is no description of what happens when Py_BuildValue fails. > Will it > decref the python object passed in? Will it not? I just want to point out that the C API documentation is pretty sil

[Python-Dev] Py_BuildValue and decref

2006-09-08 Thread Mihai Ibanescu
Hi, Looking at: http://docs.python.org/api/arg-parsing.html The description for "O" is: "O" (object) [PyObject *] Store a Python object (without any conversion) in a C object pointer. The C program thus receives the actual object that was passed. The object's reference count is not