You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document PyCFunction_New and PyCFunction_NewEx functions #60980
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?
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.
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.
rogerhurwitz commented on Feb 10, 2020
rogerhurwitzmannequin
Mannequin
More actions
I am at PyCascades at the CPython sprint, and I will work on this issue to the best of my ability.
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.
Activity
asvetlov commentedon Dec 25, 2012
c-api docs has no documentation for those public API functions.
akuchling commentedon Nov 11, 2013
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?
akuchling commentedon Nov 11, 2013
Mis-clicked and forgot to attach the patch.
vadmium commentedon Dec 17, 2014
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.
encukou commentedon Feb 4, 2020
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.
rogerhurwitz commentedon Feb 10, 2020
I am at PyCascades at the CPython sprint, and I will work on this issue to the best of my ability.
gvanrossum commentedon Feb 10, 2020
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.