A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-August/017212.html below:

[Python-Dev] PEP 265 - Sorting Dictionaries by Value

[Python-Dev] PEP 265 - Sorting Dictionaries by ValueGreg Ewing greg@cosc.canterbury.ac.nz
Thu, 23 Aug 2001 15:01:49 +1200 (NZST)
Barry Scott <barry@scottb.demon.co.uk>:

> How should all the variations be handled?

  def order(index = None, field = None, descending = 0):
    ...

Examples:

  from sorting import order

  x.sort(order(index = 3))
  x.sort(order(field = "customer_name", descending = 1))

The next step is to allow sort() itself to take the same
keyword parameters directly:

  x.sort(index = 3)
  x.sort(field = "customer_name", descending = 1)

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4