From 84c76f52afdd0c6a85ba386327bdbbdf93449f87 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 30 Oct 1990 13:32:20 +0000 Subject: Added external interface to sort a list. --- Objects/listobject.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Objects/listobject.c b/Objects/listobject.c index b02a661..97088c5 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -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}, -- cgit v0.12