* Lots of small changes related to access.
* Added "access *: ...", made access work for class methods.
* Introduced subclass check: make sure that when calling
ClassName.methodname(instance, ...), the instance is an instance of
ClassName or of a subclass thereof (this might break some old code!)
diff --git a/Include/accessobject.h b/Include/accessobject.h
index 1c67849..d50d028 100644
--- a/Include/accessobject.h
+++ b/Include/accessobject.h
@@ -50,5 +50,6 @@
void setaccessowner PROTO((object *, object *));
object *cloneaccessobject PROTO((object *));
+int hasaccessvalue PROTO((object *));
extern typeobject Anynumbertype, Anysequencetype, Anymappingtype;
diff --git a/Include/classobject.h b/Include/classobject.h
index ec07b59..ccab6a3 100644
--- a/Include/classobject.h
+++ b/Include/classobject.h
@@ -24,11 +24,7 @@
/* Class object interface */
-/*
-Classes are really hacked in at the last moment.
-It should be possible to use other object types as base classes,
-but currently it isn't. We'll see if we can fix that later, sigh...
-*/
+/* Revealing some structures (not for general use) */
typedef struct {
OB_HEAD
@@ -37,6 +33,12 @@
object *cl_name; /* A string */
} classobject;
+typedef struct {
+ OB_HEAD
+ classobject *in_class; /* The class object */
+ object *in_dict; /* A dictionary */
+} instanceobject;
+
extern typeobject Classtype, Instancetype, Instancemethodtype;
#define is_classobject(op) ((op)->ob_type == &Classtype)