summaryrefslogtreecommitdiffstats
path: root/Objects/clinic
diff options
context:
space:
mode:
authorTim Hoffmann <2836374+timhoffm@users.noreply.github.com>2019-06-01 04:10:02 (GMT)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2019-06-01 04:10:02 (GMT)
commit5c22476c01622f11b7745ee693f8b296a9d6a761 (patch)
treec541fc26a67bdd89fafa9dda524dda3ebdfdeec8 /Objects/clinic
parent396e0a8d9dc65453cb9d53500d0a620602656cfe (diff)
downloadcpython-5c22476c01622f11b7745ee693f8b296a9d6a761.zip
cpython-5c22476c01622f11b7745ee693f8b296a9d6a761.tar.gz
cpython-5c22476c01622f11b7745ee693f8b296a9d6a761.tar.bz2
Improve docstring of list.sort (GH-8516)
Diffstat (limited to 'Objects/clinic')
-rw-r--r--Objects/clinic/listobject.c.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/Objects/clinic/listobject.c.h b/Objects/clinic/listobject.c.h
index 7b8e2d9..57f0a48 100644
--- a/Objects/clinic/listobject.c.h
+++ b/Objects/clinic/listobject.c.h
@@ -156,7 +156,15 @@ PyDoc_STRVAR(list_sort__doc__,
"sort($self, /, *, key=None, reverse=False)\n"
"--\n"
"\n"
-"Stable sort *IN PLACE*.");
+"Sort the list in ascending order and return None.\n"
+"\n"
+"The sort is in-place (i.e. the list itself is modified) and stable (i.e. the\n"
+"order of two equal elements is maintained).\n"
+"\n"
+"If a key function is given, apply it once to each list item and sort them,\n"
+"ascending or descending, according to their function values.\n"
+"\n"
+"The reverse flag can be set to sort in descending order.");
#define LIST_SORT_METHODDEF \
{"sort", (PyCFunction)(void(*)(void))list_sort, METH_FASTCALL|METH_KEYWORDS, list_sort__doc__},
@@ -359,4 +367,4 @@ list___reversed__(PyListObject *self, PyObject *Py_UNUSED(ignored))
{
return list___reversed___impl(self);
}
-/*[clinic end generated code: output=d1d5078edb7d3cf4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=73718c0c33798c62 input=a9049054013a1b77]*/