[Python-Dev] Py_BuildValue and decref
Barry Warsaw
barry at python.org
Sat Sep 9 00:27:08 CEST 2006
-----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
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).
- -Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iQCVAwUBRQHuQnEjvBPtnXfVAQJfFAP9GHIRhiVc7lkzwEkPtJgqNsrN8edQcKh3
l4edSlDD7JoJrIaOElqyIaEKcJSkjpKfJt6qdA1qIt8LD9x4pGvdxpxgodGVYfFo
VGPwm+pU9SH6JJIZcCOOf9bJbEmR9iqZKceAJMGgJvZjBnTnoVSyf52254q3JJGR
b9glwqbddi0=
=3iWf
-----END PGP SIGNATURE-----
More information about the Python-Dev
mailing list