May I suggest rejecting PEP 265.

As of Py2.4, its use case is easily solved with:

>>> sorted(d.iteritems(), key=itemgetter(1), reverse=True)
[('b', 23), ('d', 17), ('c', 5), ('a', 2), ('e', 1)]

Further, Py2.5 offers a parallel solution to the more likely use case of
wanting the access only the largest counts:

>>> nlargest(2, d.iteritems(), itemgetter(1))
[('b', 23), ('d', 17)]


Raymond

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to