summaryrefslogtreecommitdiff
path: root/Include/classobject.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-12 11:45:45 +0000
committerGuido van Rossum <guido@python.org>1995-01-12 11:45:45 +0000
commita78baca8eb70be1e0781f53cef102841599aa2cf (patch)
treef978b830e2ab3b640284b2a7b6b280cde1d05d5e /Include/classobject.h
parent3f192cbb1166f22cdf4757df493fe9e79091c13f (diff)
downloadcpython-a78baca8eb70be1e0781f53cef102841599aa2cf.tar.gz
The great renaming, phase two: all header files have been updated to
use the new names exclusively, and the linker will see the new names. Files that import "Python.h" also only see the new names. Files that import "allobjects.h" will continue to be able to use the old names, due to the inclusion (in allobjects.h) of "rename2.h".
Diffstat (limited to 'Include/classobject.h')
-rw-r--r--Include/classobject.h52
1 files changed, 27 insertions, 25 deletions
diff --git a/Include/classobject.h b/Include/classobject.h
index e0e46c54e9..9c4bc51d71 100644
--- a/Include/classobject.h
+++ b/Include/classobject.h
@@ -39,40 +39,42 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* Revealing some structures (not for general use) */
typedef struct {
- OB_HEAD
- object *cl_bases; /* A tuple of class objects */
- object *cl_dict; /* A dictionary */
- object *cl_name; /* A string */
+ PyObject_HEAD
+ PyObject *cl_bases; /* A tuple of class objects */
+ PyObject *cl_dict; /* A dictionary */
+ PyObject *cl_name; /* A string */
/* The following three are functions or NULL */
- object *cl_getattr;
- object *cl_setattr;
- object *cl_delattr;
-} classobject;
+ PyObject *cl_getattr;
+ PyObject *cl_setattr;
+ PyObject *cl_delattr;
+} PyClassObject;
typedef struct {
- OB_HEAD
- classobject *in_class; /* The class object */
- object *in_dict; /* A dictionary */
-} instanceobject;
+ PyObject_HEAD
+ PyClassObject *in_class; /* The class object */
+ PyObject *in_dict; /* A dictionary */
+} PyInstanceObject;
-extern DL_IMPORT typeobject Classtype, Instancetype, Instancemethodtype;
+extern DL_IMPORT PyTypeObject PyClass_Type, PyInstance_Type, PyMethod_Type;
-#define is_classobject(op) ((op)->ob_type == &Classtype)
-#define is_instanceobject(op) ((op)->ob_type == &Instancetype)
-#define is_instancemethodobject(op) ((op)->ob_type == &Instancemethodtype)
+#define PyClass_Check(op) ((op)->ob_type == &PyClass_Type)
+#define PyInstance_Check(op) ((op)->ob_type == &PyInstance_Type)
+#define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type)
-extern object *newclassobject PROTO((object *, object *, object *));
-extern object *newinstanceobject PROTO((object *, object *));
-extern object *newinstancemethodobject PROTO((object *, object *, object *));
+extern PyObject *PyClass_New Py_PROTO((PyObject *, PyObject *, PyObject *));
+extern PyObject *PyInstance_New Py_PROTO((PyObject *, PyObject *));
+extern PyObject *PyMethod_New Py_PROTO((PyObject *, PyObject *, PyObject *));
-extern object *instancemethodgetfunc PROTO((object *));
-extern object *instancemethodgetself PROTO((object *));
-extern object *instancemethodgetclass PROTO((object *));
+extern PyObject *PyMethod_Function Py_PROTO((PyObject *));
+extern PyObject *PyMethod_Self Py_PROTO((PyObject *));
+extern PyObject *PyMethod_Class Py_PROTO((PyObject *));
-extern int issubclass PROTO((object *, object *));
+extern int PyClass_IsSubclass Py_PROTO((PyObject *, PyObject *));
-extern object *instancebinop PROTO((object *, object *, char *, char *,
- object * (*) PROTO((object *, object *)) ));
+extern PyObject *instancebinop
+ Py_PROTO((PyObject *, PyObject *,
+ char *, char *,
+ PyObject * (*) Py_PROTO((PyObject *, PyObject *)) ));
#ifdef __cplusplus
}