blob: 3021873acde093c569aaa3ac195c9f3aae3e43f4 [file] [log] [blame]
Guido van Rossumf70e43a1991-02-19 12:39:46 +00001/***********************************************************
Guido van Rossume5372401993-03-16 12:15:04 +00002Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
3Amsterdam, The Netherlands.
Guido van Rossumf70e43a1991-02-19 12:39:46 +00004
5 All Rights Reserved
6
7Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
9provided that the above copyright notice appear in all copies and that
10both that copyright notice and this permission notice appear in
11supporting documentation, and that the names of Stichting Mathematisch
12Centrum or CWI not be used in advertising or publicity pertaining to
13distribution of the software without specific, written prior permission.
14
15STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
23******************************************************************/
24
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000025/* Integer object implementation */
26
Guido van Rossum3f5da241990-12-20 15:06:42 +000027#include "allobjects.h"
Guido van Rossume5372401993-03-16 12:15:04 +000028#include "modsupport.h"
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000029
30/* Standard Booleans */
Guido van Rossum3f5da241990-12-20 15:06:42 +000031
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000032intobject FalseObject = {
33 OB_HEAD_INIT(&Inttype)
34 0
35};
Guido van Rossum3f5da241990-12-20 15:06:42 +000036
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000037intobject TrueObject = {
38 OB_HEAD_INIT(&Inttype)
39 1
40};
41
Guido van Rossum165e67e1990-10-14 20:02:26 +000042static object *
Guido van Rossum3a628451991-12-10 13:57:36 +000043err_ovf(msg)
44 char *msg;
Guido van Rossum165e67e1990-10-14 20:02:26 +000045{
Guido van Rossum3a628451991-12-10 13:57:36 +000046 err_setstr(OverflowError, msg);
Guido van Rossum165e67e1990-10-14 20:02:26 +000047 return NULL;
48}
49
Guido van Rossum3f5da241990-12-20 15:06:42 +000050/* Integers are quite normal objects, to make object handling uniform.
51 (Using odd pointers to represent integers would save much space
52 but require extra checks for this special case throughout the code.)
53 Since, a typical Python program spends much of its time allocating
54 and deallocating integers, these operations should be very fast.
55 Therefore we use a dedicated allocation scheme with a much lower
56 overhead (in space and time) than straight malloc(): a simple
57 dedicated free list, filled when necessary with memory from malloc().
58*/
59
60#define BLOCK_SIZE 1000 /* 1K less typical malloc overhead */
61#define N_INTOBJECTS (BLOCK_SIZE / sizeof(intobject))
62
63static intobject *
64fill_free_list()
65{
66 intobject *p, *q;
67 p = NEW(intobject, N_INTOBJECTS);
68 if (p == NULL)
69 return (intobject *)err_nomem();
70 q = p + N_INTOBJECTS;
71 while (--q > p)
72 *(intobject **)q = q-1;
73 *(intobject **)q = NULL;
74 return p + N_INTOBJECTS - 1;
75}
76
77static intobject *free_list = NULL;
78
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000079object *
80newintobject(ival)
81 long ival;
82{
Guido van Rossum3f5da241990-12-20 15:06:42 +000083 register intobject *v;
84 if (free_list == NULL) {
85 if ((free_list = fill_free_list()) == NULL)
86 return NULL;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000087 }
Guido van Rossum3f5da241990-12-20 15:06:42 +000088 v = free_list;
89 free_list = *(intobject **)free_list;
90 NEWREF(v);
91 v->ob_type = &Inttype;
92 v->ob_ival = ival;
93 return (object *) v;
94}
95
96static void
97int_dealloc(v)
98 intobject *v;
99{
100 *(intobject **)v = free_list;
101 free_list = v;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000102}
103
104long
105getintvalue(op)
106 register object *op;
107{
108 if (!is_intobject(op)) {
Guido van Rossum5c52b6a1990-10-21 22:11:03 +0000109 err_badcall();
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000110 return -1;
111 }
112 else
113 return ((intobject *)op) -> ob_ival;
114}
115
116/* Methods */
117
Guido van Rossum719f5fa1992-03-27 17:31:02 +0000118/* ARGSUSED */
Guido van Rossum90933611991-06-07 16:10:43 +0000119static int
Guido van Rossum3f5da241990-12-20 15:06:42 +0000120int_print(v, fp, flags)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000121 intobject *v;
122 FILE *fp;
Guido van Rossum719f5fa1992-03-27 17:31:02 +0000123 int flags; /* Not used but required by interface */
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000124{
125 fprintf(fp, "%ld", v->ob_ival);
Guido van Rossum90933611991-06-07 16:10:43 +0000126 return 0;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000127}
128
129static object *
Guido van Rossum3f5da241990-12-20 15:06:42 +0000130int_repr(v)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000131 intobject *v;
132{
133 char buf[20];
134 sprintf(buf, "%ld", v->ob_ival);
135 return newstringobject(buf);
136}
137
138static int
Guido van Rossum3f5da241990-12-20 15:06:42 +0000139int_compare(v, w)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000140 intobject *v, *w;
141{
142 register long i = v->ob_ival;
143 register long j = w->ob_ival;
144 return (i < j) ? -1 : (i > j) ? 1 : 0;
145}
146
Guido van Rossum9bfef441993-03-29 10:43:31 +0000147static long
148int_hash(v)
149 intobject *v;
150{
151 long x = v -> ob_ival;
152 if (x == -1)
153 x = -2;
154 return x;
155}
156
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000157static object *
Guido van Rossum3f5da241990-12-20 15:06:42 +0000158int_add(v, w)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000159 intobject *v;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000160 intobject *w;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000161{
162 register long a, b, x;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000163 a = v->ob_ival;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000164 b = w->ob_ival;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000165 x = a + b;
Guido van Rossum165e67e1990-10-14 20:02:26 +0000166 if ((x^a) < 0 && (x^b) < 0)
Guido van Rossum3a628451991-12-10 13:57:36 +0000167 return err_ovf("integer addition");
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000168 return newintobject(x);
169}
170
171static object *
Guido van Rossum3f5da241990-12-20 15:06:42 +0000172int_sub(v, w)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000173 intobject *v;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000174 intobject *w;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000175{
176 register long a, b, x;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000177 a = v->ob_ival;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000178 b = w->ob_ival;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000179 x = a - b;
Guido van Rossum165e67e1990-10-14 20:02:26 +0000180 if ((x^a) < 0 && (x^~b) < 0)
Guido van Rossum3a628451991-12-10 13:57:36 +0000181 return err_ovf("integer subtraction");
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000182 return newintobject(x);
183}
184
185static object *
Guido van Rossum3f5da241990-12-20 15:06:42 +0000186int_mul(v, w)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000187 intobject *v;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000188 intobject *w;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000189{
190 register long a, b;
191 double x;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000192 a = v->ob_ival;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000193 b = w->ob_ival;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000194 x = (double)a * (double)b;
Guido van Rossum165e67e1990-10-14 20:02:26 +0000195 if (x > 0x7fffffff || x < (double) (long) 0x80000000)
Guido van Rossum3a628451991-12-10 13:57:36 +0000196 return err_ovf("integer multiplication");
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000197 return newintobject(a * b);
198}
199
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000200static int
201i_divmod(x, y, p_xdivy, p_xmody)
202 register intobject *x, *y;
203 long *p_xdivy, *p_xmody;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000204{
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000205 long xi = x->ob_ival;
206 long yi = y->ob_ival;
207 long xdivy, xmody;
208
209 if (yi == 0) {
210 err_setstr(ZeroDivisionError, "integer division or modulo");
211 return -1;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000212 }
Guido van Rossum00466951991-05-05 20:08:27 +0000213 if (yi < 0) {
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000214 if (xi < 0)
215 xdivy = -xi / -yi;
216 else
217 xdivy = - (xi / -yi);
Guido van Rossum00466951991-05-05 20:08:27 +0000218 }
219 else {
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000220 if (xi < 0)
221 xdivy = - (-xi / yi);
222 else
223 xdivy = xi / yi;
Guido van Rossum00466951991-05-05 20:08:27 +0000224 }
225 xmody = xi - xdivy*yi;
226 if (xmody < 0 && yi > 0 || xmody > 0 && yi < 0) {
227 xmody += yi;
228 xdivy -= 1;
229 }
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000230 *p_xdivy = xdivy;
231 *p_xmody = xmody;
232 return 0;
233}
234
235static object *
236int_div(x, y)
237 intobject *x;
238 intobject *y;
239{
240 long d, m;
241 if (i_divmod(x, y, &d, &m) < 0)
242 return NULL;
243 return newintobject(d);
244}
245
246static object *
247int_mod(x, y)
248 intobject *x;
249 intobject *y;
250{
251 long d, m;
252 if (i_divmod(x, y, &d, &m) < 0)
253 return NULL;
Guido van Rossum719f5fa1992-03-27 17:31:02 +0000254 return newintobject(m);
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000255}
256
257static object *
258int_divmod(x, y)
259 intobject *x;
260 intobject *y;
261{
262 object *v, *v0, *v1;
263 long d, m;
264 if (i_divmod(x, y, &d, &m) < 0)
265 return NULL;
Guido van Rossume5372401993-03-16 12:15:04 +0000266 return mkvalue("(ll)", d, m);
Guido van Rossum00466951991-05-05 20:08:27 +0000267}
268
269static object *
Guido van Rossum3f5da241990-12-20 15:06:42 +0000270int_pow(v, w)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000271 intobject *v;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000272 intobject *w;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000273{
274 register long iv, iw, ix;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000275 iv = v->ob_ival;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000276 iw = w->ob_ival;
Guido van Rossum00466951991-05-05 20:08:27 +0000277 if (iw < 0) {
Guido van Rossum3a628451991-12-10 13:57:36 +0000278 err_setstr(ValueError, "integer to the negative power");
Guido van Rossum00466951991-05-05 20:08:27 +0000279 return NULL;
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000280 }
Guido van Rossum00466951991-05-05 20:08:27 +0000281 ix = 1;
282 while (--iw >= 0) {
283 long prev = ix;
284 ix = ix * iv;
285 if (iv == 0)
286 break; /* 0 to some power -- avoid ix / 0 */
287 if (ix / iv != prev)
Guido van Rossum3a628451991-12-10 13:57:36 +0000288 return err_ovf("integer pow()");
Guido van Rossum00466951991-05-05 20:08:27 +0000289 }
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000290 return newintobject(ix);
291}
292
293static object *
Guido van Rossum3f5da241990-12-20 15:06:42 +0000294int_neg(v)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000295 intobject *v;
296{
297 register long a, x;
298 a = v->ob_ival;
299 x = -a;
Guido van Rossum165e67e1990-10-14 20:02:26 +0000300 if (a < 0 && x < 0)
Guido van Rossum3a628451991-12-10 13:57:36 +0000301 return err_ovf("integer negation");
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000302 return newintobject(x);
303}
304
305static object *
Guido van Rossum3f5da241990-12-20 15:06:42 +0000306int_pos(v)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000307 intobject *v;
308{
309 INCREF(v);
310 return (object *)v;
311}
312
Guido van Rossum00466951991-05-05 20:08:27 +0000313static object *
314int_abs(v)
315 intobject *v;
316{
317 if (v->ob_ival >= 0)
318 return int_pos(v);
319 else
320 return int_neg(v);
321}
322
Guido van Rossum0bff0151991-05-14 12:05:32 +0000323static int
324int_nonzero(v)
325 intobject *v;
326{
327 return v->ob_ival != 0;
328}
329
Guido van Rossum7928cd71991-10-24 14:59:31 +0000330static object *
331int_invert(v)
332 intobject *v;
333{
334 return newintobject(~v->ob_ival);
335}
336
337static object *
338int_lshift(v, w)
339 intobject *v;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000340 intobject *w;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000341{
342 register long a, b;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000343 a = v->ob_ival;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000344 b = w->ob_ival;
Guido van Rossumf3b351f1992-01-14 18:33:22 +0000345 if (b < 0) {
346 err_setstr(ValueError, "negative shift count");
347 return NULL;
348 }
349 if (a == 0 || b == 0) {
350 INCREF(v);
351 return (object *) v;
352 }
353 if (b >= 32) {
354 return newintobject(0L);
355 }
356 a = (unsigned long)a << b;
357 return newintobject(a);
Guido van Rossum7928cd71991-10-24 14:59:31 +0000358}
359
360static object *
361int_rshift(v, w)
362 intobject *v;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000363 intobject *w;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000364{
365 register long a, b;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000366 a = v->ob_ival;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000367 b = w->ob_ival;
Guido van Rossumf3b351f1992-01-14 18:33:22 +0000368 if (b < 0) {
369 err_setstr(ValueError, "negative shift count");
370 return NULL;
371 }
372 if (a == 0 || b == 0) {
373 INCREF(v);
374 return (object *) v;
375 }
376 if (b >= 32) {
377 if (a < 0)
378 a = -1;
379 else
380 a = 0;
381 }
382 else {
383 if (a < 0)
384 a = ~( ~(unsigned long)a >> b );
385 else
386 a = (unsigned long)a >> b;
387 }
388 return newintobject(a);
Guido van Rossum7928cd71991-10-24 14:59:31 +0000389}
390
391static object *
392int_and(v, w)
393 intobject *v;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000394 intobject *w;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000395{
396 register long a, b;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000397 a = v->ob_ival;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000398 b = w->ob_ival;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000399 return newintobject(a & b);
400}
401
402static object *
403int_xor(v, w)
404 intobject *v;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000405 intobject *w;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000406{
407 register long a, b;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000408 a = v->ob_ival;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000409 b = w->ob_ival;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000410 return newintobject(a ^ b);
411}
412
413static object *
414int_or(v, w)
415 intobject *v;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000416 intobject *w;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000417{
418 register long a, b;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000419 a = v->ob_ival;
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000420 b = w->ob_ival;
Guido van Rossum7928cd71991-10-24 14:59:31 +0000421 return newintobject(a | b);
422}
423
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000424static object *
425int_int(v)
Guido van Rossum9bfef441993-03-29 10:43:31 +0000426 intobject *v;
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000427{
428 INCREF(v);
Guido van Rossum9575a441993-04-07 14:06:14 +0000429 return (object *)v;
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000430}
431
432static object *
433int_long(v)
Guido van Rossum9bfef441993-03-29 10:43:31 +0000434 intobject *v;
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000435{
Guido van Rossum9bfef441993-03-29 10:43:31 +0000436 return newlongobject((v -> ob_ival));
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000437}
438
439static object *
440int_float(v)
Guido van Rossum9bfef441993-03-29 10:43:31 +0000441 intobject *v;
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000442{
Guido van Rossum9bfef441993-03-29 10:43:31 +0000443 return newfloatobject((double)(v -> ob_ival));
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000444}
445
446static object *
447int_oct(v)
Guido van Rossum9bfef441993-03-29 10:43:31 +0000448 intobject *v;
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000449{
450 char buf[20];
Guido van Rossum9bfef441993-03-29 10:43:31 +0000451 long x = v -> ob_ival;
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000452 if (x == 0)
453 strcpy(buf, "0");
454 else if (x > 0)
455 sprintf(buf, "0%lo", x);
456 else
457 sprintf(buf, "-0%lo", -x);
458 return newstringobject(buf);
459}
460
461static object *
462int_hex(v)
Guido van Rossum9bfef441993-03-29 10:43:31 +0000463 intobject *v;
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000464{
465 char buf[20];
Guido van Rossum9bfef441993-03-29 10:43:31 +0000466 long x = v -> ob_ival;
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000467 if (x >= 0)
468 sprintf(buf, "0x%lx", x);
469 else
470 sprintf(buf, "-0x%lx", -x);
471 return newstringobject(buf);
472}
473
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000474static number_methods int_as_number = {
Guido van Rossum00466951991-05-05 20:08:27 +0000475 int_add, /*nb_add*/
476 int_sub, /*nb_subtract*/
477 int_mul, /*nb_multiply*/
478 int_div, /*nb_divide*/
Guido van Rossum2b16a6f1992-01-19 16:28:51 +0000479 int_mod, /*nb_remainder*/
Guido van Rossum00466951991-05-05 20:08:27 +0000480 int_divmod, /*nb_divmod*/
481 int_pow, /*nb_power*/
482 int_neg, /*nb_negative*/
483 int_pos, /*nb_positive*/
484 int_abs, /*nb_absolute*/
Guido van Rossum0bff0151991-05-14 12:05:32 +0000485 int_nonzero, /*nb_nonzero*/
Guido van Rossum7928cd71991-10-24 14:59:31 +0000486 int_invert, /*nb_invert*/
487 int_lshift, /*nb_lshift*/
488 int_rshift, /*nb_rshift*/
489 int_and, /*nb_and*/
490 int_xor, /*nb_xor*/
491 int_or, /*nb_or*/
Guido van Rossum1899c2e1992-09-12 11:09:23 +0000492 0, /*nb_coerce*/
493 int_int, /*nb_int*/
494 int_long, /*nb_long*/
495 int_float, /*nb_float*/
496 int_oct, /*nb_oct*/
497 int_hex, /*nb_hex*/
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000498};
499
500typeobject Inttype = {
501 OB_HEAD_INIT(&Typetype)
502 0,
503 "int",
504 sizeof(intobject),
505 0,
Guido van Rossum3f5da241990-12-20 15:06:42 +0000506 int_dealloc, /*tp_dealloc*/
507 int_print, /*tp_print*/
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000508 0, /*tp_getattr*/
509 0, /*tp_setattr*/
Guido van Rossum3f5da241990-12-20 15:06:42 +0000510 int_compare, /*tp_compare*/
511 int_repr, /*tp_repr*/
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000512 &int_as_number, /*tp_as_number*/
513 0, /*tp_as_sequence*/
514 0, /*tp_as_mapping*/
Guido van Rossum9575a441993-04-07 14:06:14 +0000515 int_hash, /*tp_hash*/
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000516};