summaryrefslogtreecommitdiff
path: root/Include/dictobject.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-03-29 10:43:31 +0000
committerGuido van Rossum <guido@python.org>1993-03-29 10:43:31 +0000
commit2cba547761869fe149e665d91bcb13fa5abff4d3 (patch)
tree711953e6ed82215e0aae84ad425c2573bdfbd93a /Include/dictobject.h
parent50eefde432319edd1b2b659278a01baa872ef22f (diff)
downloadcpython-2cba547761869fe149e665d91bcb13fa5abff4d3.tar.gz
* 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/dictobject.h')
-rw-r--r--Include/dictobject.h33
1 files changed, 14 insertions, 19 deletions
diff --git a/Include/dictobject.h b/Include/dictobject.h
index 2c5d539498..ce71570ab4 100644
--- a/Include/dictobject.h
+++ b/Include/dictobject.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
@@ -22,28 +22,23 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
-/*
-Dictionary object type -- mapping from char * to object.
-NB: the key is given as a char *, not as a stringobject.
-These functions set errno for errors. Functions dictremove() and
-dictinsert() return nonzero for errors, getdictsize() returns -1,
-the others NULL. A successful call to dictinsert() calls INCREF()
-for the inserted item.
-*/
+/* All in the sake of backward compatibility... */
-extern typeobject Dicttype;
+#include "mappingobject.h"
-#define is_dictobject(op) ((op)->ob_type == &Dicttype)
+#define is_dictobject(op) is_mappingobject(op)
+
+#define newdictobject newmappingobject
-extern object *newdictobject PROTO((void));
extern object *dictlookup PROTO((object *dp, char *key));
extern int dictinsert PROTO((object *dp, char *key, object *item));
extern int dictremove PROTO((object *dp, char *key));
-extern int getdictsize PROTO((object *dp));
extern char *getdictkey PROTO((object *dp, int i));
-extern object *getdictkeys PROTO((object *dp));
-extern object *getdict2key PROTO((object *dp, int i));
-extern object *dict2lookup PROTO((object *dp, object *key));
-extern int dict2insert PROTO((object *dp, object *key, object *item));
-extern int dict2remove PROTO((object *dp, object *key));
+#define getdictsize getmappingsize
+#define getdictkeys getmappingkeys
+
+#define getdict2key getmappingkey
+#define dict2lookup mappinglookup
+#define dict2insert mappinginsert
+#define dict2remove mappingremove