mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Added external interface to sort a list.
This commit is contained in:
parent
726749cc5b
commit
84c76f52af
1 changed files with 15 additions and 0 deletions
|
@ -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},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue