New function gettupleslice(v, i, j).

This commit is contained in:
Guido van Rossum 1992-01-14 18:45:33 +00:00
parent 11c03836a2
commit 7c36ad7f44
2 changed files with 13 additions and 0 deletions

View File

@ -51,6 +51,7 @@ extern object *newtupleobject PROTO((int size));
extern int gettuplesize PROTO((object *));
extern object *gettupleitem PROTO((object *, int));
extern int settupleitem PROTO((object *, int, object *));
extern object *gettupleslice PROTO((object *, int, int));
/* Macro, trading safety for speed */
#define GETTUPLEITEM(op, i) ((op)->ob_item[i])

View File

@ -228,6 +228,18 @@ tupleslice(a, ilow, ihigh)
return (object *)np;
}
object *
gettupleslice(op, i, j)
object *op;
int i, j;
{
if (op == NULL || !is_tupleobject(op)) {
err_badcall();
return NULL;
}
return tupleslice((tupleobject *)op, i, j);
}
static object *
tupleconcat(a, bb)
register tupleobject *a;