Mercurial > cpython-lru_cache-weakref
diff Include/classobject.h @ 1290:7971fecbf28e legacy-trunk
* 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!)
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 21 May 1993 19:56:10 +0000 |
| parents | 4d292c7857d4 |
| children | 519c25039c6a |
line wrap: on
line diff
--- a/Include/classobject.h Thu May 20 14:24:46 1993 +0000 +++ b/Include/classobject.h Fri May 21 19:56:10 1993 +0000 @@ -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)
