Record the rejection of PEP 265.

The requested functionality was largely fulfilled by Py2.4's sorted()
function.  See Guido's 6/17/2005 note on python-dev.
This commit is contained in:
Raymond Hettinger 2005-06-17 04:30:41 +00:00
parent 873af4a927
commit b052f52afd
2 changed files with 22 additions and 3 deletions

View File

@ -80,7 +80,6 @@ Index by Category
S 256 Docstring Processing System Framework Goodger
S 258 Docutils Design Specification Goodger
SD 262 Database of Installed Python Packages Kuchling
S 265 Sorting Dictionaries by Value Griffin
S 266 Optimizing Global Variable/Attribute Access Montanaro
S 267 Optimized Access to Module Namespaces Hylton
S 268 Extended HTTP functionality and WebDAV Stein
@ -200,6 +199,7 @@ Index by Category
SR 242 Numeric Kinds Dubois
SR 244 The `directive' Statement von Loewis
SR 259 Omit printing newline after newline GvR
SR 265 Sorting Dictionaries by Value Griffin
SD 269 Pgen Module for Python Riehl
SR 270 uniq method for list objects Petrone
SR 271 Prefixing sys.path by command line option Giacometti
@ -307,7 +307,7 @@ Numerical Index
SD 262 Database of Installed Python Packages Kuchling
SF 263 Defining Python Source Code Encodings Lemburg
SF 264 Future statements in simulated shells Hudson
S 265 Sorting Dictionaries by Value Griffin
SR 265 Sorting Dictionaries by Value Griffin
S 266 Optimizing Global Variable/Attribute Access Montanaro
S 267 Optimized Access to Module Namespaces Hylton
S 268 Extended HTTP functionality and WebDAV Stein

View File

@ -2,7 +2,7 @@ PEP: 265
Title: Sorting Dictionaries by Value
Version: $Revision$
Author: g2@iowegian.com (Grant Griffin)
Status: Draft
Status: Rejected
Type: Standards Track
Created: 8-Aug-2001
Python-Version: 2.2
@ -17,6 +17,25 @@ Abstract
both difficult for beginners to understand and cumbersome for all
to implement.
BDFL Pronouncement
This PEP is rejected because the need for it has been largely
fulfilled by Py2.4's sorted() builtin function:
>>> sorted(d.iteritems(), key=itemgetter(1), reverse=True)
[('b', 23), ('d', 17), ('c', 5), ('a', 2), ('e', 1)]
or for just the keys:
sorted(d, key=d.__getitem__, reverse=True)
['b', 'd', 'c', 'a', 'e']
Also, Python 2.5's heapq.nlargest() function addresses the common use
case of finding only a few of the highest valued items:
>>> nlargest(2, d.iteritems(), itemgetter(1))
[('b', 23), ('d', 17)]
Motivation