Mercurial > cpython-lru_cache-weakref
diff Include/mappingobject.h @ 1288:9fed5726a36d legacy-trunk
Several changes in one:
(1) dictionaries/mappings now have attributes values() and items() as
well as keys(); at the C level, use the new function mappinggetnext()
to iterate over a dictionary.
(2) "class C(): ..." is now illegal; you must write "class C: ...".
(3) Class objects now know their own name (finally!); and minor
improvements to the way how classes, functions and methods are
represented as strings.
(4) Added an "access" statement and semantics. (This is still
experimental -- as long as you don't use the keyword 'access' nothing
should be changed.)
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 19 May 1993 14:50:45 +0000 |
| parents | 7aa9613ffd36 |
| children | 519c25039c6a |
line wrap: on
line diff
--- a/Include/mappingobject.h Mon May 17 08:34:16 1993 +0000 +++ b/Include/mappingobject.h Wed May 19 14:50:45 1993 +0000 @@ -22,22 +22,19 @@ ******************************************************************/ -/* -Mapping object type -- mapping from object to object. -These functions set errno for errors. Functions mappingremove() and -mappinginsert() return nonzero for errors, getmappingsize() returns -1, -the others NULL. A successful call to mappinginsert() calls INCREF() -for the inserted item. -*/ +/* Mapping object type -- mapping from hashable object to object */ extern typeobject Mappingtype; #define is_mappingobject(op) ((op)->ob_type == &Mappingtype) extern object *newmappingobject PROTO((void)); -extern object *mappinglookup PROTO((object *dp, object *key)); -extern int mappinginsert PROTO((object *dp, object *key, object *item)); -extern int mappingremove PROTO((object *dp, object *key)); -extern int getmappingsize PROTO((object *dp)); -extern object *getmappingkey PROTO((object *dp, int i)); -extern object *getmappingkeys PROTO((object *dp)); +extern object *mappinglookup PROTO((object *mp, object *key)); +extern int mappinginsert PROTO((object *mp, object *key, object *item)); +extern int mappingremove PROTO((object *mp, object *key)); +extern void mappingclear PROTO((object *mp)); +extern int mappinggetnext + PROTO((object *mp, int *pos, object **key, object **value)); +extern object *getmappingkeys PROTO((object *mp)); +extern object *getmappingvalues PROTO((object *mp)); +extern object *getmappingitems PROTO((object *mp));
