[New-bugs-announce] [issue9755] Fix refcounting details in Py3k C API documentation

Nick Coghlan report at bugs.python.org
Fri Sep 3 13:43:44 CEST 2010

New submission from Nick Coghlan <ncoghlan at gmail.com>:

As noted in [1] the refcount data for the C API documentation is contained in a separate file at Doc/data/refcounts.dat.

This file is not mentioned in "Documenting Python" and hence has not been correctly updated for Py3k (e.g. none of the PyString methods have been renamed to PyUnicode in that file, so the relevant refcount changes are not documented correctly).

There are several possible improvements to be considered in this area
1. Mention this file and its purpose in "Documenting Python"
2. Update the Sphinx extension to warn if a C API function is not found in this file
3. Update the Sphinx extension to allow this information to be expressed inline in the function definition rather than off in a separate file (if practical)
4. Address Skip's comment from that file by allowing "-0" to indicate stolen references for arguments and "+0" for borrowed references as return values
5. Perhaps add a mechanism to indicate when PyMem_Free needs to be called on a return value or pointer output value.

[1] http://mail.python.org/pipermail/python-dev/2010-September/103429.html

messages: 115441
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Fix refcounting details in Py3k C API documentation

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list