Mercurial > cpython-lru_cache-weakref
annotate Objects/tupleobject.c @ 1330:409ea74feb21 legacy-trunk
Minor fixes / changes for Mac compatibility.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 29 Jul 1993 08:25:09 +0000 |
| parents | 6ee380349c84 |
| children | a22a350d3a5d |
| rev | line source |
|---|---|
| 145 | 1 /*********************************************************** |
|
1257
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
2 Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum, |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
3 Amsterdam, The Netherlands. |
| 145 | 4 |
| 5 All Rights Reserved | |
| 6 | |
| 7 Permission to use, copy, modify, and distribute this software and its | |
| 8 documentation for any purpose and without fee is hereby granted, | |
| 9 provided that the above copyright notice appear in all copies and that | |
| 10 both that copyright notice and this permission notice appear in | |
| 11 supporting documentation, and that the names of Stichting Mathematisch | |
| 12 Centrum or CWI not be used in advertising or publicity pertaining to | |
| 13 distribution of the software without specific, written prior permission. | |
| 14 | |
| 15 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO | |
| 16 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
| 17 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE | |
| 18 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
| 19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
| 20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
| 21 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
| 22 | |
| 23 ******************************************************************/ | |
| 24 | |
| 6 | 25 /* Tuple object implementation */ |
| 26 | |
| 86 | 27 #include "allobjects.h" |
| 6 | 28 |
| 29 object * | |
| 30 newtupleobject(size) | |
| 31 register int size; | |
| 32 { | |
| 33 register int i; | |
| 34 register tupleobject *op; | |
| 35 if (size < 0) { | |
| 27 | 36 err_badcall(); |
| 6 | 37 return NULL; |
| 38 } | |
| 39 op = (tupleobject *) | |
| 40 malloc(sizeof(tupleobject) + size * sizeof(object *)); | |
| 27 | 41 if (op == NULL) |
| 42 return err_nomem(); | |
| 6 | 43 NEWREF(op); |
| 44 op->ob_type = &Tupletype; | |
| 45 op->ob_size = size; | |
| 46 for (i = 0; i < size; i++) | |
| 47 op->ob_item[i] = NULL; | |
| 48 return (object *) op; | |
| 49 } | |
| 50 | |
| 51 int | |
| 52 gettuplesize(op) | |
| 53 register object *op; | |
| 54 { | |
| 55 if (!is_tupleobject(op)) { | |
| 27 | 56 err_badcall(); |
| 6 | 57 return -1; |
| 58 } | |
| 59 else | |
| 60 return ((tupleobject *)op)->ob_size; | |
| 61 } | |
| 62 | |
| 63 object * | |
| 64 gettupleitem(op, i) | |
| 65 register object *op; | |
| 66 register int i; | |
| 67 { | |
| 68 if (!is_tupleobject(op)) { | |
| 27 | 69 err_badcall(); |
| 6 | 70 return NULL; |
| 71 } | |
| 72 if (i < 0 || i >= ((tupleobject *)op) -> ob_size) { | |
| 27 | 73 err_setstr(IndexError, "tuple index out of range"); |
| 6 | 74 return NULL; |
| 75 } | |
| 76 return ((tupleobject *)op) -> ob_item[i]; | |
| 77 } | |
| 78 | |
| 79 int | |
| 80 settupleitem(op, i, newitem) | |
| 81 register object *op; | |
| 82 register int i; | |
| 83 register object *newitem; | |
| 84 { | |
| 85 register object *olditem; | |
| 86 if (!is_tupleobject(op)) { | |
| 87 if (newitem != NULL) | |
| 88 DECREF(newitem); | |
| 27 | 89 err_badcall(); |
| 90 return -1; | |
| 6 | 91 } |
| 92 if (i < 0 || i >= ((tupleobject *)op) -> ob_size) { | |
| 93 if (newitem != NULL) | |
| 94 DECREF(newitem); | |
| 27 | 95 err_setstr(IndexError, "tuple assignment index out of range"); |
| 96 return -1; | |
| 6 | 97 } |
| 98 olditem = ((tupleobject *)op) -> ob_item[i]; | |
| 99 ((tupleobject *)op) -> ob_item[i] = newitem; | |
| 100 if (olditem != NULL) | |
| 101 DECREF(olditem); | |
| 102 return 0; | |
| 103 } | |
| 104 | |
| 105 /* Methods */ | |
| 106 | |
| 107 static void | |
| 108 tupledealloc(op) | |
| 109 register tupleobject *op; | |
| 110 { | |
| 111 register int i; | |
| 112 for (i = 0; i < op->ob_size; i++) { | |
| 113 if (op->ob_item[i] != NULL) | |
| 114 DECREF(op->ob_item[i]); | |
| 115 } | |
| 116 free((ANY *)op); | |
| 117 } | |
| 118 | |
|
288
9b43a983124c
printobject now returns an error code
Guido van Rossum <guido@python.org>
parents:
258
diff
changeset
|
119 static int |
| 6 | 120 tupleprint(op, fp, flags) |
| 121 tupleobject *op; | |
| 122 FILE *fp; | |
| 123 int flags; | |
| 124 { | |
| 125 int i; | |
| 126 fprintf(fp, "("); | |
|
288
9b43a983124c
printobject now returns an error code
Guido van Rossum <guido@python.org>
parents:
258
diff
changeset
|
127 for (i = 0; i < op->ob_size; i++) { |
|
9b43a983124c
printobject now returns an error code
Guido van Rossum <guido@python.org>
parents:
258
diff
changeset
|
128 if (i > 0) |
| 6 | 129 fprintf(fp, ", "); |
|
288
9b43a983124c
printobject now returns an error code
Guido van Rossum <guido@python.org>
parents:
258
diff
changeset
|
130 if (printobject(op->ob_item[i], fp, flags) != 0) |
|
9b43a983124c
printobject now returns an error code
Guido van Rossum <guido@python.org>
parents:
258
diff
changeset
|
131 return -1; |
| 6 | 132 } |
| 133 if (op->ob_size == 1) | |
| 134 fprintf(fp, ","); | |
| 135 fprintf(fp, ")"); | |
|
288
9b43a983124c
printobject now returns an error code
Guido van Rossum <guido@python.org>
parents:
258
diff
changeset
|
136 return 0; |
| 6 | 137 } |
| 138 | |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
139 static object * |
| 6 | 140 tuplerepr(v) |
| 141 tupleobject *v; | |
| 142 { | |
| 143 object *s, *t, *comma; | |
| 144 int i; | |
| 145 s = newstringobject("("); | |
| 146 comma = newstringobject(", "); | |
| 147 for (i = 0; i < v->ob_size && s != NULL; i++) { | |
| 148 if (i > 0) | |
| 149 joinstring(&s, comma); | |
| 150 t = reprobject(v->ob_item[i]); | |
| 151 joinstring(&s, t); | |
| 152 if (t != NULL) | |
| 153 DECREF(t); | |
| 154 } | |
| 155 DECREF(comma); | |
| 156 if (v->ob_size == 1) { | |
| 157 t = newstringobject(","); | |
| 158 joinstring(&s, t); | |
| 159 DECREF(t); | |
| 160 } | |
| 161 t = newstringobject(")"); | |
| 162 joinstring(&s, t); | |
| 163 DECREF(t); | |
| 164 return s; | |
| 165 } | |
| 166 | |
| 167 static int | |
| 168 tuplecompare(v, w) | |
| 169 register tupleobject *v, *w; | |
| 170 { | |
| 171 register int len = | |
| 172 (v->ob_size < w->ob_size) ? v->ob_size : w->ob_size; | |
| 173 register int i; | |
| 174 for (i = 0; i < len; i++) { | |
| 175 int cmp = cmpobject(v->ob_item[i], w->ob_item[i]); | |
| 176 if (cmp != 0) | |
| 177 return cmp; | |
| 178 } | |
| 179 return v->ob_size - w->ob_size; | |
| 180 } | |
| 181 | |
|
1257
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
182 static long |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
183 tuplehash(v) |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
184 tupleobject *v; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
185 { |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
186 register long x, y; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
187 register int len = v->ob_size; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
188 register object **p; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
189 x = 0x345678L; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
190 p = v->ob_item; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
191 while (--len >= 0) { |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
192 y = hashobject(*p++); |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
193 if (y == -1) |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
194 return -1; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
195 x = (x + x + x) ^ y; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
196 } |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
197 x ^= v->ob_size; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
198 if (x == -1) |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
199 x = -2; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
200 return x; |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
201 } |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
202 |
| 6 | 203 static int |
| 204 tuplelength(a) | |
| 205 tupleobject *a; | |
| 206 { | |
| 207 return a->ob_size; | |
| 208 } | |
| 209 | |
| 210 static object * | |
| 211 tupleitem(a, i) | |
| 212 register tupleobject *a; | |
| 213 register int i; | |
| 214 { | |
| 215 if (i < 0 || i >= a->ob_size) { | |
| 27 | 216 err_setstr(IndexError, "tuple index out of range"); |
| 6 | 217 return NULL; |
| 218 } | |
| 219 INCREF(a->ob_item[i]); | |
| 220 return a->ob_item[i]; | |
| 221 } | |
| 222 | |
| 223 static object * | |
| 224 tupleslice(a, ilow, ihigh) | |
| 225 register tupleobject *a; | |
| 226 register int ilow, ihigh; | |
| 227 { | |
| 228 register tupleobject *np; | |
| 229 register int i; | |
| 230 if (ilow < 0) | |
| 231 ilow = 0; | |
| 232 if (ihigh > a->ob_size) | |
| 233 ihigh = a->ob_size; | |
| 234 if (ihigh < ilow) | |
| 235 ihigh = ilow; | |
| 236 if (ilow == 0 && ihigh == a->ob_size) { | |
| 237 /* XXX can only do this if tuples are immutable! */ | |
| 238 INCREF(a); | |
| 239 return (object *)a; | |
| 240 } | |
| 241 np = (tupleobject *)newtupleobject(ihigh - ilow); | |
| 242 if (np == NULL) | |
| 243 return NULL; | |
| 244 for (i = ilow; i < ihigh; i++) { | |
| 245 object *v = a->ob_item[i]; | |
| 246 INCREF(v); | |
| 247 np->ob_item[i - ilow] = v; | |
| 248 } | |
| 249 return (object *)np; | |
| 250 } | |
| 251 | |
|
599
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
252 object * |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
253 gettupleslice(op, i, j) |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
254 object *op; |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
255 int i, j; |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
256 { |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
257 if (op == NULL || !is_tupleobject(op)) { |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
258 err_badcall(); |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
259 return NULL; |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
260 } |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
261 return tupleslice((tupleobject *)op, i, j); |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
262 } |
|
a347933a6d92
New function gettupleslice(v, i, j).
Guido van Rossum <guido@python.org>
parents:
288
diff
changeset
|
263 |
| 6 | 264 static object * |
| 265 tupleconcat(a, bb) | |
| 266 register tupleobject *a; | |
| 267 register object *bb; | |
| 268 { | |
| 269 register int size; | |
| 270 register int i; | |
| 271 tupleobject *np; | |
| 272 if (!is_tupleobject(bb)) { | |
| 27 | 273 err_badarg(); |
| 6 | 274 return NULL; |
| 275 } | |
| 276 #define b ((tupleobject *)bb) | |
| 277 size = a->ob_size + b->ob_size; | |
| 278 np = (tupleobject *) newtupleobject(size); | |
| 279 if (np == NULL) { | |
|
288
9b43a983124c
printobject now returns an error code
Guido van Rossum <guido@python.org>
parents:
258
diff
changeset
|
280 return NULL; |
| 6 | 281 } |
| 282 for (i = 0; i < a->ob_size; i++) { | |
| 283 object *v = a->ob_item[i]; | |
| 284 INCREF(v); | |
| 285 np->ob_item[i] = v; | |
| 286 } | |
| 287 for (i = 0; i < b->ob_size; i++) { | |
| 288 object *v = b->ob_item[i]; | |
| 289 INCREF(v); | |
| 290 np->ob_item[i + a->ob_size] = v; | |
| 291 } | |
| 292 return (object *)np; | |
| 293 #undef b | |
| 294 } | |
| 295 | |
|
258
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
296 static object * |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
297 tuplerepeat(a, n) |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
298 tupleobject *a; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
299 int n; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
300 { |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
301 int i, j; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
302 int size; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
303 tupleobject *np; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
304 object **p; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
305 if (n < 0) |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
306 n = 0; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
307 if (a->ob_size*n == a->ob_size) { |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
308 /* Since tuples are immutable, we can return a shared |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
309 copy in this case */ |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
310 INCREF(a); |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
311 return (object *)a; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
312 } |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
313 size = a->ob_size * n; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
314 np = (tupleobject *) newtupleobject(size); |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
315 if (np == NULL) |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
316 return NULL; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
317 p = np->ob_item; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
318 for (i = 0; i < n; i++) { |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
319 for (j = 0; j < a->ob_size; j++) { |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
320 *p = a->ob_item[j]; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
321 INCREF(*p); |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
322 p++; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
323 } |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
324 } |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
325 return (object *) np; |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
326 } |
|
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
327 |
| 6 | 328 static sequence_methods tuple_as_sequence = { |
| 329 tuplelength, /*sq_length*/ | |
| 330 tupleconcat, /*sq_concat*/ | |
|
258
3b93bcea10f6
Finally implement tuple*number. From now on all sequence types
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
331 tuplerepeat, /*sq_repeat*/ |
| 6 | 332 tupleitem, /*sq_item*/ |
| 333 tupleslice, /*sq_slice*/ | |
| 334 0, /*sq_ass_item*/ | |
| 335 0, /*sq_ass_slice*/ | |
| 336 }; | |
| 337 | |
| 338 typeobject Tupletype = { | |
| 339 OB_HEAD_INIT(&Typetype) | |
| 340 0, | |
| 341 "tuple", | |
| 342 sizeof(tupleobject) - sizeof(object *), | |
| 343 sizeof(object *), | |
| 344 tupledealloc, /*tp_dealloc*/ | |
| 345 tupleprint, /*tp_print*/ | |
| 346 0, /*tp_getattr*/ | |
| 347 0, /*tp_setattr*/ | |
| 348 tuplecompare, /*tp_compare*/ | |
| 349 tuplerepr, /*tp_repr*/ | |
| 350 0, /*tp_as_number*/ | |
| 351 &tuple_as_sequence, /*tp_as_sequence*/ | |
| 352 0, /*tp_as_mapping*/ | |
|
1257
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
353 tuplehash, /*tp_hash*/ |
| 6 | 354 }; |
