1
/* Former class object interface -- now only bound methods are here */
3
/* Revealing some structures (not for general use) */
5
#ifndef Py_CLASSOBJECT_H
6
#define Py_CLASSOBJECT_H
13
PyObject *im_func; /* The callable object implementing the method */
14
PyObject *im_self; /* The instance it is bound to */
15
PyObject *im_weakreflist; /* List of weak references */
18
PyAPI_DATA(PyTypeObject) PyMethod_Type;
20
#define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type)
22
PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
24
PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
25
PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
27
/* Macros for direct access to these values. Type checks are *not*
28
done, so use with care. */
29
#define PyMethod_GET_FUNCTION(meth) \
30
(((PyMethodObject *)meth) -> im_func)
31
#define PyMethod_GET_SELF(meth) \
32
(((PyMethodObject *)meth) -> im_self)
34
PyAPI_FUNC(int) PyMethod_ClearFreeList(void);
39
} PyInstanceMethodObject;
41
PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
43
#define PyInstanceMethod_Check(op) ((op)->ob_type == &PyInstanceMethod_Type)
45
PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *);
46
PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
48
/* Macros for direct access to these values. Type checks are *not*
49
done, so use with care. */
50
#define PyInstanceMethod_GET_FUNCTION(meth) \
51
(((PyInstanceMethodObject *)meth) -> func)
56
#endif /* !Py_CLASSOBJECT_H */