diff options
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index dd2a40b..a38f354 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -106,6 +106,36 @@ PyClass_New(PyObject *bases, PyObject *dict, PyObject *name) return (PyObject *) op; } +PyObject * +PyMethod_Function(PyObject *im) +{ + if (!PyMethod_Check(im)) { + PyErr_BadInternalCall(); + return NULL; + } + return ((PyMethodObject *)im)->im_func; +} + +PyObject * +PyMethod_Self(PyObject *im) +{ + if (!PyMethod_Check(im)) { + PyErr_BadInternalCall(); + return NULL; + } + return ((PyMethodObject *)im)->im_self; +} + +PyObject * +PyMethod_Class(PyObject *im) +{ + if (!PyMethod_Check(im)) { + PyErr_BadInternalCall(); + return NULL; + } + return ((PyMethodObject *)im)->im_class; +} + static PyObject * class_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { |