[Python-Dev] Py_BuildValue and decref
barry at python.org
Sat Sep 9 00:27:08 CEST 2006
-----BEGIN PGP SIGNED MESSAGE-----
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
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
val? What about if that function fails? Has val been incref'd or
not? What about the side-effects on any value the new one replaces,
both in success and failure?
The C API documentation has improved in documenting the refcount
behavior for return values of many of the functions, but the only
reliable way to know what some other side-effects are is to read the
code. After I perfect my human cloning techniques, I'll be assigning
one of my minions to fix this situation (I'll bet my clean-the-kitty-
litter-and-stalk-er-keep-tabs-on-Britney clone would love to take a
break for a few weeks to work on this).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
-----END PGP SIGNATURE-----
More information about the Python-Dev