[docs] Possible document issue.

Georg Brandl georg at python.org
Sun Oct 6 11:03:45 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 02.08.2013 16:01, schrieb Issaria Peng:
> Hi,
> 
> http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst
> 
> 509 
> <http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst#l509>
> /* Time to call the callback */ 510 
> <http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst#l510>
> arglist = Py_BuildValue("(i)", arg); 511 
> <http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst#l511>
> result = PyObject_CallObject(my_callback, arglist); 512 
> <http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst#l512>
> Py_DECREF(arglist); 513 
> <http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst#l513>
>
> 
514
> <http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst#l514>
> :c:func:`PyObject_CallObject` returns a Python object pointer: this is the
> return 515 
> <http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst#l515>
> value of the Python function. :c:func:`PyObject_CallObject` is 516 
> <http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst#l516>
> "reference-count-neutral" with respect to its arguments. In the example a
> new 517 
> <http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst#l517>
> tuple was created to serve as the argument list, which is
> :c:func:`Py_DECREF`\ 518 
> <http://hg.python.org/cpython/file/52e166a975f9/Doc/extending/extending.rst#l518>
> -ed immediately after the call.
> 
> According to the explain directly after the code, line 512 should be:
> 
> Py_DECREF(result);


Hi Issaria,

thanks for the report; I've clarified this now and it should appear online soon.

cheers,
Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (GNU/Linux)

iEYEARECAAYFAlJRJ3EACgkQN9GcIYhpnLCTKQCeIk2fjP1o4FPNiMMFDGw5TFsC
UQsAoIw+RKPmk7wTfCsBApNqZv8Vfzcz
=YnxU
-----END PGP SIGNATURE-----


More information about the docs mailing list