From 7c36ad7f449c54b8fc445aea28d17bf87fa6f2ea Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 14 Jan 1992 18:45:33 +0000 Subject: [PATCH] New function gettupleslice(v, i, j). --- Include/tupleobject.h | 1 + Objects/tupleobject.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/Include/tupleobject.h b/Include/tupleobject.h index abdf1eafb49..5a84ef23966 100644 --- a/Include/tupleobject.h +++ b/Include/tupleobject.h @@ -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]) diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index bce7fdf8da0..ab2cf181cc2 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -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;