[issue16776] Document PyCFunction_New and PyCFunction_NewEx functions

New submission from Andrew Svetlov: c-api docs has no documentation for those public API functions. ---------- assignee: docs@python components: Documentation keywords: easy messages: 178115 nosy: asvetlov, docs@python priority: normal severity: normal status: open title: Document PyCFunction_New and PyCFunction_NewEx functions type: enhancement versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16776> _______________________________________

A.M. Kuchling added the comment: Here's a patch that contains text for a description of these two functions. However, I can't figure out what section they would belong in. They don't really belong in http://docs.python.org/3.4/c-api/structures.html, which is for the C structures. Also note that PyCFunctionObject isn't described anywhere. Should it be? ---------- nosy: +akuchling _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16776> _______________________________________

A.M. Kuchling added the comment: Mis-clicked and forgot to attach the patch. ---------- Added file: http://bugs.python.org/file32578/16776.txt _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16776> _______________________________________

Changes by STINNER Victor <victor.stinner@gmail.com>: ---------- nosy: +haypo _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16776> _______________________________________

Martin Panter added the comment: I’m far from an expert on the C API, but I was looking for a way to inspect a “builtin_function_or_method” a.k.a. PyCFunction_Type a.k.a. types.BuiltinMethodType, and ended up looking at the “Instance Method Objects” section. So maybe your functions should go near there, or perhaps the nearby “Function Objects” section. ---------- nosy: +vadmium _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16776> _______________________________________

Changes by A.M. Kuchling <amk@amk.ca>: ---------- nosy: -akuchling _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16776> _______________________________________

Petr Viktorin <encukou@gmail.com> added the comment: IMO, PyCFunction* should be a CPython-specific implementation detail: alternate implementations of the C-API don't need to support them, and extension authors should be fine without using them. (And if not, more efforts like PEP 590 Vectorcall should make it so.) The functions are public in the sense that they don't have underscored names, but I wouldn't rush to make them documented. ---------- nosy: +petr.viktorin _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue16776> _______________________________________

Roger Hurwitz <rogerhurwitz@gmail.com> added the comment: I am at PyCascades at the CPython sprint, and I will work on this issue to the best of my ability. ---------- nosy: +rogerhurwitz _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue16776> _______________________________________

Guido van Rossum <guido@python.org> added the comment: I'm sprinting with Roger. Based on Petr's comment I am closing this issue -- if we should not draw attention to this function let's not document it. @svetlov if you still think it should be documented, can you suggest where the documentation should go? The best place we could come up with is in the file where Andrew put it. ---------- nosy: +gvanrossum resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue16776> _______________________________________
participants (7)
-
A.M. Kuchling
-
Andrew Svetlov
-
Guido van Rossum
-
Martin Panter
-
Petr Viktorin
-
Roger Hurwitz
-
STINNER Victor