cpython/Objects/methodobject.c


/* Method object implementation */

#include "Python.h"
#include "pycore_call.h"          // _Py_CheckFunctionResult()
#include "pycore_ceval.h"         // _Py_EnterRecursiveCallTstate()
#include "pycore_object.h"
#include "pycore_pyerrors.h"
#include "pycore_pystate.h"       // _PyThreadState_GET()


/* undefine macro trampoline to PyCFunction_NewEx */
#undef PyCFunction_New
/* undefine macro trampoline to PyCMethod_New */
#undef PyCFunction_NewEx

/* Forward declarations */
static PyObject * cfunction_vectorcall_FASTCALL(
    PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * cfunction_vectorcall_FASTCALL_KEYWORDS(
    PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * cfunction_vectorcall_FASTCALL_KEYWORDS_METHOD(
    PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * cfunction_vectorcall_NOARGS(
    PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * cfunction_vectorcall_O(
    PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * cfunction_call(
    PyObject *func, PyObject *args, PyObject *kwargs);


PyObject *
PyCFunction_New(PyMethodDef *ml, PyObject *self)
{}

PyObject *
PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module)
{}

PyObject *
PyCMethod_New(PyMethodDef *ml, PyObject *self, PyObject *module, PyTypeObject *cls)
{}

PyCFunction
PyCFunction_GetFunction(PyObject *op)
{}

PyObject *
PyCFunction_GetSelf(PyObject *op)
{}

int
PyCFunction_GetFlags(PyObject *op)
{}

PyTypeObject *
PyCMethod_GetClass(PyObject *op)
{}

/* Methods (the standard built-in methods, that is) */

static void
meth_dealloc(PyObject *self)
{}

static PyObject *
meth_reduce(PyObject *self, PyObject *Py_UNUSED(ignored))
{}

static PyMethodDef meth_methods[] =;

static PyObject *
meth_get__text_signature__(PyObject *self, void *closure)
{}

static PyObject *
meth_get__doc__(PyObject *self, void *closure)
{}

static PyObject *
meth_get__name__(PyObject *self, void *closure)
{}

static PyObject *
meth_get__qualname__(PyObject *self, void *closure)
{}

static int
meth_traverse(PyObject *self, visitproc visit, void *arg)
{}

static PyObject *
meth_get__self__(PyObject *meth, void *closure)
{}

static PyGetSetDef meth_getsets[] =;

#define OFF(x)

static PyMemberDef meth_members[] =;

static PyObject *
meth_repr(PyObject *self)
{}

static PyObject *
meth_richcompare(PyObject *self, PyObject *other, int op)
{}

static Py_hash_t
meth_hash(PyObject *self)
{}


PyTypeObject PyCFunction_Type =;

PyTypeObject PyCMethod_Type =;

/* Vectorcall functions for each of the PyCFunction calling conventions,
 * except for METH_VARARGS (possibly combined with METH_KEYWORDS) which
 * doesn't use vectorcall.
 *
 * First, common helpers
 */

static inline int
cfunction_check_kwargs(PyThreadState *tstate, PyObject *func, PyObject *kwnames)
{}

funcptr;

static inline funcptr
cfunction_enter_call(PyThreadState *tstate, PyObject *func)
{}

/* Now the actual vectorcall functions */
static PyObject *
cfunction_vectorcall_FASTCALL(
    PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{}

static PyObject *
cfunction_vectorcall_FASTCALL_KEYWORDS(
    PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{}

static PyObject *
cfunction_vectorcall_FASTCALL_KEYWORDS_METHOD(
    PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{}

static PyObject *
cfunction_vectorcall_NOARGS(
    PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{}

static PyObject *
cfunction_vectorcall_O(
    PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{}


static PyObject *
cfunction_call(PyObject *func, PyObject *args, PyObject *kwargs)
{}