Staging
v0.8.1
https://github.com/python/cpython
Revision b27ce7e46843841e8e8f2c9e5108044d022ae248 authored by Christian Heimes on 02 December 2007, 14:44:17 UTC, committed by Christian Heimes on 02 December 2007, 14:44:17 UTC
1 parent 217cfd1
Raw File
Tip revision: b27ce7e46843841e8e8f2c9e5108044d022ae248 authored by Christian Heimes on 02 December 2007, 14:44:17 UTC
Changed #ifdef 0 to #if 0.
Tip revision: b27ce7e
classobject.h
/* Former class object interface -- now only bound methods are here  */

/* Revealing some structures (not for general use) */

#ifndef Py_CLASSOBJECT_H
#define Py_CLASSOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    PyObject_HEAD
    PyObject *im_func;   /* The callable object implementing the method */
    PyObject *im_self;   /* The instance it is bound to */
    PyObject *im_weakreflist; /* List of weak references */
} PyMethodObject;

PyAPI_DATA(PyTypeObject) PyMethod_Type;

#define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type)

PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);

PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);

/* Macros for direct access to these values. Type checks are *not*
   done, so use with care. */
#define PyMethod_GET_FUNCTION(meth) \
        (((PyMethodObject *)meth) -> im_func)
#define PyMethod_GET_SELF(meth) \
	(((PyMethodObject *)meth) -> im_self)

#ifdef __cplusplus
}
#endif
#endif /* !Py_CLASSOBJECT_H */
back to top