| 1 |
|
|---|
| 2 | /* Class object interface */
|
|---|
| 3 |
|
|---|
| 4 | /* Revealing some structures (not for general use) */
|
|---|
| 5 |
|
|---|
| 6 | #ifndef Py_CLASSOBJECT_H
|
|---|
| 7 | #define Py_CLASSOBJECT_H
|
|---|
| 8 | #ifdef __cplusplus
|
|---|
| 9 | extern "C" {
|
|---|
| 10 | #endif
|
|---|
| 11 |
|
|---|
| 12 | typedef struct {
|
|---|
| 13 | PyObject_HEAD
|
|---|
| 14 | PyObject *cl_bases; /* A tuple of class objects */
|
|---|
| 15 | PyObject *cl_dict; /* A dictionary */
|
|---|
| 16 | PyObject *cl_name; /* A string */
|
|---|
| 17 | /* The following three are functions or NULL */
|
|---|
| 18 | PyObject *cl_getattr;
|
|---|
| 19 | PyObject *cl_setattr;
|
|---|
| 20 | PyObject *cl_delattr;
|
|---|
| 21 | } PyClassObject;
|
|---|
| 22 |
|
|---|
| 23 | typedef struct {
|
|---|
| 24 | PyObject_HEAD
|
|---|
| 25 | PyClassObject *in_class; /* The class object */
|
|---|
| 26 | PyObject *in_dict; /* A dictionary */
|
|---|
| 27 | PyObject *in_weakreflist; /* List of weak references */
|
|---|
| 28 | } PyInstanceObject;
|
|---|
| 29 |
|
|---|
| 30 | typedef struct {
|
|---|
| 31 | PyObject_HEAD
|
|---|
| 32 | PyObject *im_func; /* The callable object implementing the method */
|
|---|
| 33 | PyObject *im_self; /* The instance it is bound to, or NULL */
|
|---|
| 34 | PyObject *im_class; /* The class that asked for the method */
|
|---|
| 35 | PyObject *im_weakreflist; /* List of weak references */
|
|---|
| 36 | } PyMethodObject;
|
|---|
| 37 |
|
|---|
| 38 | PyAPI_DATA(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type;
|
|---|
|
|---|