diff options
| author | Georg Brandl <georg@python.org> | 2008-01-06 15:34:57 (GMT) |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2008-01-06 15:34:57 (GMT) |
| commit | a8cbad3b834a60abc211dfcc76ad0612c834b931 (patch) | |
| tree | e42c3adb51a83180f1f635abe2fe6398eca16b79 | |
| parent | 437e15d42b91434d6ec493be264e1d398daf828e (diff) | |
| download | cpython-a8cbad3b834a60abc211dfcc76ad0612c834b931.zip cpython-a8cbad3b834a60abc211dfcc76ad0612c834b931.tar.gz cpython-a8cbad3b834a60abc211dfcc76ad0612c834b931.tar.bz2 | |
#1755097: document default values for [].sort() and sorted().
| -rw-r--r-- | Doc/library/functions.rst | 5 | ||||
| -rw-r--r-- | Doc/library/stdtypes.rst | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index e153bc8..6720f19 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1038,10 +1038,11 @@ available. They are listed here in alphabetical order. *cmp* specifies a custom comparison function of two arguments (iterable elements) which should return a negative, zero or positive number depending on whether the first argument is considered smaller than, equal to, or larger than - the second argument: ``cmp=lambda x,y: cmp(x.lower(), y.lower())`` + the second argument: ``cmp=lambda x,y: cmp(x.lower(), y.lower())``. The default + value is ``None``. *key* specifies a function of one argument that is used to extract a comparison - key from each list element: ``key=str.lower`` + key from each list element: ``key=str.lower``. The default value is ``None``. *reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed. diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index d3c5c63..d7e7d49 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1408,10 +1408,11 @@ Notes: *cmp* specifies a custom comparison function of two arguments (list items) which should return a negative, zero or positive number depending on whether the first argument is considered smaller than, equal to, or larger than the second - argument: ``cmp=lambda x,y: cmp(x.lower(), y.lower())`` + argument: ``cmp=lambda x,y: cmp(x.lower(), y.lower())``. The default value + is ``None``. *key* specifies a function of one argument that is used to extract a comparison - key from each list element: ``key=str.lower`` + key from each list element: ``key=str.lower``. The default value is ``None``. *reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed. |
