]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added external interface to sort a list.
authorGuido van Rossum <guido@python.org>
Tue, 30 Oct 1990 13:32:20 +0000 (13:32 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 30 Oct 1990 13:32:20 +0000 (13:32 +0000)
Objects/listobject.c

index b02a661a991e586ba265fc665df6d654ecfd26fc..97088c519ba0674624dc65754ea1971164a0349e 100644 (file)
@@ -453,6 +453,21 @@ listsort(self, args)
        return None;
 }
 
+int
+sortlist(v)
+       object *v;
+{
+       if (v == NULL || !is_listobject(v)) {
+               err_badcall();
+               return -1;
+       }
+       v = listsort((listobject *)v, (object *)NULL);
+       if (v == NULL)
+               return -1;
+       DECREF(v);
+       return 0;
+}
+
 static struct methodlist list_methods[] = {
        {"append",      listappend},
        {"insert",      listinsert},