diff options
author | Raymond Hettinger <python@rcn.com> | 2003-10-16 03:41:09 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-10-16 03:41:09 (GMT) |
commit | 42b1ba31aff86af6257a0fca455d5569bce9d8fc (patch) | |
tree | 0497ccd614d5ed8a4cfbb2bce4362f61faf0aeb1 /Misc | |
parent | 90f7d254a9ae20d6d783138eb8567f39e6ff7e04 (diff) | |
download | cpython-42b1ba31aff86af6257a0fca455d5569bce9d8fc.zip cpython-42b1ba31aff86af6257a0fca455d5569bce9d8fc.tar.gz cpython-42b1ba31aff86af6257a0fca455d5569bce9d8fc.tar.bz2 |
* list.sort() now supports three keyword arguments: cmp, key, and reverse.
key provides C support for the decorate-sort-undecorate pattern.
reverse provide a stable sort of the list with the comparisions reversed.
* Amended the docs to guarantee sort stability.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -12,6 +12,15 @@ What's New in Python 2.4 alpha 1? Core and builtins ----------------- +- list.sort() now supports three keyword arguments: cmp, key, and reverse. + The key argument can be a function of one argument that extracts a + comparison key from the original record: mylist.sort(key=str.lower). + The reverse argument is a boolean value and if True will change the + sort order as if the comparison arguments were reversed. In addition, + the documentation has been amended to provide a guarantee that all sorts + starting with Py2.3 are guaranteed to be stable (the relative order of + records with equal keys is unchanged). + - Added test whether wchar_t is signed or not. A signed wchar_t is not usable as internal unicode type base for Py_UNICODE since the unicode implementation assumes an unsigned type. |