Skip to content

Commit 72cb640

Browse files
author
guido
committed
* 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 git-svn-id: http://svn.python.org/projects/python/trunk@3422 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent f9a6d64 commit 72cb640

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+559
-246
lines changed

Include/assert.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************
2-
Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
3-
Netherlands.
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
44
55
All Rights Reserved
66

Include/bitset.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************
2-
Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
3-
Netherlands.
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
44
55
All Rights Reserved
66

Include/bltinmodule.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************
2-
Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
3-
Netherlands.
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
44
55
All Rights Reserved
66

Include/ceval.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************
2-
Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
3-
Netherlands.
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
44
55
All Rights Reserved
66

Include/cgensupport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************
2-
Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
3-
Netherlands.
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
44
55
All Rights Reserved
66

Include/classobject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************
2-
Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
3-
Netherlands.
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
44
55
All Rights Reserved
66

Include/compile.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************
2-
Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
3-
Netherlands.
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
44
55
All Rights Reserved
66
@@ -28,14 +28,17 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2828
/* An intermediate code fragment contains:
2929
- a string that encodes the instructions,
3030
- a list of the constants,
31-
- and a list of the names used. */
31+
- a list of the names used,
32+
- the filename from which it was compiled,
33+
- the name of the object for which it was compiled. */
3234

3335
typedef struct {
3436
OB_HEAD
3537
stringobject *co_code; /* instruction opcodes */
3638
object *co_consts; /* list of immutable constant objects */
3739
object *co_names; /* list of stringobjects */
3840
object *co_filename; /* string */
41+
object *co_name; /* string */
3942
} codeobject;
4043

4144
extern typeobject Codetype;
@@ -46,4 +49,5 @@ extern typeobject Codetype;
4649
/* Public interface */
4750
struct _node; /* Declare the existence of this type */
4851
codeobject *compile PROTO((struct _node *, char *));
49-
codeobject *newcodeobject PROTO((object *, object *, object *, object *));
52+
codeobject *newcodeobject
53+
PROTO((object *, object *, object *, object *, object *));

Include/dictobject.h

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************
2-
Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
3-
Netherlands.
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
44
55
All Rights Reserved
66
@@ -22,28 +22,23 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2222
2323
******************************************************************/
2424

25-
/*
26-
Dictionary object type -- mapping from char * to object.
27-
NB: the key is given as a char *, not as a stringobject.
28-
These functions set errno for errors. Functions dictremove() and
29-
dictinsert() return nonzero for errors, getdictsize() returns -1,
30-
the others NULL. A successful call to dictinsert() calls INCREF()
31-
for the inserted item.
32-
*/
25+
/* All in the sake of backward compatibility... */
3326

34-
extern typeobject Dicttype;
27+
#include "mappingobject.h"
3528

36-
#define is_dictobject(op) ((op)->ob_type == &Dicttype)
29+
#define is_dictobject(op) is_mappingobject(op)
30+
31+
#define newdictobject newmappingobject
3732

38-
extern object *newdictobject PROTO((void));
3933
extern object *dictlookup PROTO((object *dp, char *key));
4034
extern int dictinsert PROTO((object *dp, char *key, object *item));
4135
extern int dictremove PROTO((object *dp, char *key));
42-
extern int getdictsize PROTO((object *dp));
4336
extern char *getdictkey PROTO((object *dp, int i));
44-
extern object *getdictkeys PROTO((object *dp));
4537

46-
extern object *getdict2key PROTO((object *dp, int i));
47-
extern object *dict2lookup PROTO((object *dp, object *key));
48-
extern int dict2insert PROTO((object *dp, object *key, object *item));
49-
extern int dict2remove PROTO((object *dp, object *key));
38+
#define getdictsize getmappingsize
39+
#define getdictkeys getmappingkeys
40+
41+
#define getdict2key getmappingkey
42+
#define dict2lookup mappinglookup
43+
#define dict2insert mappinginsert
44+
#define dict2remove mappingremove

Include/errcode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************
2-
Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
3-
Netherlands.
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
44
55
All Rights Reserved
66

Include/errors.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************
2-
Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
3-
Netherlands.
2+
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3+
Amsterdam, The Netherlands.
44
55
All Rights Reserved
66

0 commit comments

Comments
 (0)