Mercurial > cpython-lru_cache-weakref
annotate Include/classobject.h @ 1590:ac2e5cc29949 legacy-trunk
Added tests for missing host to open_http and open_gopher
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 18 Apr 1994 09:39:56 +0000 |
| parents | c914b10bf2ed |
| children | 1940892d2fe3 |
| rev | line source |
|---|---|
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
1 #ifndef Py_CLASSOBJECT_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
2 #define Py_CLASSOBJECT_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
3 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
4 extern "C" { |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
5 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
6 |
| 145 | 7 /*********************************************************** |
|
1257
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
955
diff
changeset
|
8 Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum, |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
955
diff
changeset
|
9 Amsterdam, The Netherlands. |
| 145 | 10 |
| 11 All Rights Reserved | |
| 12 | |
| 13 Permission to use, copy, modify, and distribute this software and its | |
| 14 documentation for any purpose and without fee is hereby granted, | |
| 15 provided that the above copyright notice appear in all copies and that | |
| 16 both that copyright notice and this permission notice appear in | |
| 17 supporting documentation, and that the names of Stichting Mathematisch | |
| 18 Centrum or CWI not be used in advertising or publicity pertaining to | |
| 19 distribution of the software without specific, written prior permission. | |
| 20 | |
| 21 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO | |
| 22 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
| 23 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE | |
| 24 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
| 25 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
| 26 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
| 27 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
| 28 | |
| 29 ******************************************************************/ | |
| 30 | |
| 6 | 31 /* Class object interface */ |
| 32 | |
|
1290
7971fecbf28e
* Lots of small changes related to access.
Guido van Rossum <guido@python.org>
parents:
1289
diff
changeset
|
33 /* Revealing some structures (not for general use) */ |
| 6 | 34 |
|
1289
4d292c7857d4
Access checks now work, at least for instance data (not for methods
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
35 typedef struct { |
|
4d292c7857d4
Access checks now work, at least for instance data (not for methods
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
36 OB_HEAD |
|
4d292c7857d4
Access checks now work, at least for instance data (not for methods
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
37 object *cl_bases; /* A tuple of class objects */ |
|
4d292c7857d4
Access checks now work, at least for instance data (not for methods
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
38 object *cl_dict; /* A dictionary */ |
|
4d292c7857d4
Access checks now work, at least for instance data (not for methods
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
39 object *cl_name; /* A string */ |
|
4d292c7857d4
Access checks now work, at least for instance data (not for methods
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
40 } classobject; |
|
4d292c7857d4
Access checks now work, at least for instance data (not for methods
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
41 |
|
1290
7971fecbf28e
* Lots of small changes related to access.
Guido van Rossum <guido@python.org>
parents:
1289
diff
changeset
|
42 typedef struct { |
|
7971fecbf28e
* Lots of small changes related to access.
Guido van Rossum <guido@python.org>
parents:
1289
diff
changeset
|
43 OB_HEAD |
|
7971fecbf28e
* Lots of small changes related to access.
Guido van Rossum <guido@python.org>
parents:
1289
diff
changeset
|
44 classobject *in_class; /* The class object */ |
|
7971fecbf28e
* Lots of small changes related to access.
Guido van Rossum <guido@python.org>
parents:
1289
diff
changeset
|
45 object *in_dict; /* A dictionary */ |
|
7971fecbf28e
* Lots of small changes related to access.
Guido van Rossum <guido@python.org>
parents:
1289
diff
changeset
|
46 } instanceobject; |
|
7971fecbf28e
* Lots of small changes related to access.
Guido van Rossum <guido@python.org>
parents:
1289
diff
changeset
|
47 |
|
225
7819e1615320
Renamed class members to instances and class methods to instance methods
Guido van Rossum <guido@python.org>
parents:
175
diff
changeset
|
48 extern typeobject Classtype, Instancetype, Instancemethodtype; |
| 6 | 49 |
| 50 #define is_classobject(op) ((op)->ob_type == &Classtype) | |
|
225
7819e1615320
Renamed class members to instances and class methods to instance methods
Guido van Rossum <guido@python.org>
parents:
175
diff
changeset
|
51 #define is_instanceobject(op) ((op)->ob_type == &Instancetype) |
|
7819e1615320
Renamed class members to instances and class methods to instance methods
Guido van Rossum <guido@python.org>
parents:
175
diff
changeset
|
52 #define is_instancemethodobject(op) ((op)->ob_type == &Instancemethodtype) |
| 6 | 53 |
|
387
f01aee6155b3
newclassobject gets a third parameter (optional class name)
Guido van Rossum <guido@python.org>
parents:
225
diff
changeset
|
54 extern object *newclassobject PROTO((object *, object *, object *)); |
|
1288
9fed5726a36d
Several changes in one:
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
55 extern object *newinstanceobject PROTO((object *, object *)); |
|
1289
4d292c7857d4
Access checks now work, at least for instance data (not for methods
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
56 extern object *newinstancemethodobject PROTO((object *, object *, object *)); |
| 6 | 57 |
|
225
7819e1615320
Renamed class members to instances and class methods to instance methods
Guido van Rossum <guido@python.org>
parents:
175
diff
changeset
|
58 extern object *instancemethodgetfunc PROTO((object *)); |
|
7819e1615320
Renamed class members to instances and class methods to instance methods
Guido van Rossum <guido@python.org>
parents:
175
diff
changeset
|
59 extern object *instancemethodgetself PROTO((object *)); |
|
1289
4d292c7857d4
Access checks now work, at least for instance data (not for methods
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
60 extern object *instancemethodgetclass PROTO((object *)); |
|
944
222f04f55083
Changes so that user-defined classes can implement operations invoked
Guido van Rossum <guido@python.org>
parents:
790
diff
changeset
|
61 |
|
1289
4d292c7857d4
Access checks now work, at least for instance data (not for methods
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
62 extern int issubclass PROTO((object *, object *)); |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
63 |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
64 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
65 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
66 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1290
diff
changeset
|
67 #endif /* !Py_CLASSOBJECT_H */ |
