Added external interface to sort a list.

This commit is contained in:
Guido van Rossum 1990-10-30 13:32:20 +00:00
parent 726749cc5b
commit 84c76f52af
1 changed files with 15 additions and 0 deletions

View 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},