diff options
author | Guido van Rossum <guido@python.org> | 1993-05-20 14:24:46 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-05-20 14:24:46 (GMT) |
commit | 81daa32c15cfa9f05eda037916cdbfd5b4323431 (patch) | |
tree | 82d67f6db4ff6f1ae1a682f2ec4b01d075f3e405 /Include/classobject.h | |
parent | 25831652fd4c03323066d4cafdc0551c396a993e (diff) | |
download | cpython-81daa32c15cfa9f05eda037916cdbfd5b4323431.zip cpython-81daa32c15cfa9f05eda037916cdbfd5b4323431.tar.gz cpython-81daa32c15cfa9f05eda037916cdbfd5b4323431.tar.bz2 |
Access checks now work, at least for instance data (not for methods
yet). The class is now passed to eval_code and stored in the current
frame. It is also stored in instance method objects. An "unbound"
instance method is now returned when a function is retrieved through
"classname.funcname", which when called passes the class to eval_code.
Diffstat (limited to 'Include/classobject.h')
-rw-r--r-- | Include/classobject.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Include/classobject.h b/Include/classobject.h index b9bbc9b..ec07b59 100644 --- a/Include/classobject.h +++ b/Include/classobject.h @@ -30,6 +30,13 @@ 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... */ +typedef struct { + OB_HEAD + object *cl_bases; /* A tuple of class objects */ + object *cl_dict; /* A dictionary */ + object *cl_name; /* A string */ +} classobject; + extern typeobject Classtype, Instancetype, Instancemethodtype; #define is_classobject(op) ((op)->ob_type == &Classtype) @@ -38,9 +45,12 @@ extern typeobject Classtype, Instancetype, Instancemethodtype; extern object *newclassobject PROTO((object *, object *, object *)); extern object *newinstanceobject PROTO((object *, object *)); -extern object *newinstancemethodobject PROTO((object *, object *)); +extern object *newinstancemethodobject PROTO((object *, object *, object *)); extern object *instancemethodgetfunc PROTO((object *)); extern object *instancemethodgetself PROTO((object *)); +extern object *instancemethodgetclass PROTO((object *)); extern object *instance_convert PROTO((object *, char *)); + +extern int issubclass PROTO((object *, object *)); |