[Python-ideas] Meta-PEP about C functions
J.Demeyer at UGent.be
Wed Jun 13 11:15:24 EDT 2018
I have finished my "meta-PEP" for issues with built-in (implemented in
C) functions and methods. This is meant to become an "informational"
(not standards track) PEP for other PEPs to refer to.
You can read the full text at
I also give brief ideas of solutions for the various issues. The main
idea is a new PyTypeObject field tp_ccalloffset giving an offset in the
object structure for a new PyCCallDef struct. This new struct replaces
PyMethodDef for calling functions/methods and defines a new "C call"
protocol. Comparing with PEP 575, one could say that the base_function
class has been replaced by PyCCallDef. This is even more general than
PEP 575 and it should be easier to support this new protocol in existing
I plan to submit this as PEP in the next days, but I wanted to check for
some early feedback first.
More information about the Python-ideas