mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +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;
|
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[] = {
|
static struct methodlist list_methods[] = {
|
||||||
{"append", listappend},
|
{"append", listappend},
|
||||||
{"insert", listinsert},
|
{"insert", listinsert},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue