summaryrefslogtreecommitdiffstats
path: root/Include/object.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-03-29 10:43:31 (GMT)
committerGuido van Rossum <guido@python.org>1993-03-29 10:43:31 (GMT)
commit9bfef44d97d1ae24e03717e3d59024b44626a9de (patch)
tree736b9f406d27f9dc4496f103cd395fb7a97401d4 /Include/object.h
parent4b1302bd1d211881178618aa8f41fa4460180f2e (diff)
downloadcpython-9bfef44d97d1ae24e03717e3d59024b44626a9de.zip
cpython-9bfef44d97d1ae24e03717e3d59024b44626a9de.tar.gz
cpython-9bfef44d97d1ae24e03717e3d59024b44626a9de.tar.bz2
* Changed all copyright messages to include 1993.
* Stubs for faster implementation of local variables (not yet finished) * Added function name to code object. Print it for code and function objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version number has changed accordingly) * Print address of self for built-in methods * New internal functions getattro and setattro (getattr/setattr with string object arg) * Replaced "dictobject" with more powerful "mappingobject" * New per-type functio tp_hash to implement arbitrary object hashing, and hashobject() to interface to it * Added built-in functions hash(v) and hasattr(v, 'name') * classobject: made some functions static that accidentally weren't; added __hash__ special instance method to implement hash() * Added proper comparison for built-in methods and functions
Diffstat (limited to 'Include/object.h')
-rw-r--r--Include/object.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/Include/object.h b/Include/object.h
index f644be3..ff02bea 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -1,6 +1,6 @@
/***********************************************************
-Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
-Netherlands.
+Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
All Rights Reserved
@@ -188,6 +188,10 @@ typedef struct _typeobject {
number_methods *tp_as_number;
sequence_methods *tp_as_sequence;
mapping_methods *tp_as_mapping;
+
+ /* More standard operations (at end for binary compatibility) */
+
+ long (*tp_hash) FPROTO((object *));
} typeobject;
extern typeobject Typetype; /* The type of type objects */
@@ -199,7 +203,9 @@ extern int printobject PROTO((object *, FILE *, int));
extern object * reprobject PROTO((object *));
extern int cmpobject PROTO((object *, object *));
extern object *getattr PROTO((object *, char *));
-extern int setattr PROTO((object *, char *, object *));
+extern object *getattro PROTO((object *, object *));
+extern int setattro PROTO((object *, object *, object *));
+extern long hashobject PROTO((object *));
/* Flag bits for printing: */
#define PRINT_RAW 1 /* No string quotes etc. */