]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
New function gettupleslice(v, i, j).
authorGuido van Rossum <guido@python.org>
Tue, 14 Jan 1992 18:45:33 +0000 (18:45 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 14 Jan 1992 18:45:33 +0000 (18:45 +0000)
Include/tupleobject.h
Objects/tupleobject.c

index abdf1eafb499245bb503aed5896a3744b9774116..5a84ef239667a3ecc9ae2b593ad8e87fb9feb1c5 100644 (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])
index bce7fdf8da01a6c5740f920f137cd7361ded6858..ab2cf181cc2dae24e90f45d5041d0b34c718130f 100644 (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;