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/2003-October/038659.html below:

[Python-Dev] decorate-sort-undecorate

[Python-Dev] decorate-sort-undecorate [Python-Dev] decorate-sort-undecorateIan Bicking ianb at colorstudy.com
Mon Oct 13 17:29:01 EDT 2003
On Monday, October 13, 2003, at 02:34 PM, Raymond Hettinger wrote:
> For Py2.4, I propose adding an optional list.sort() argument to 
> support the decorate-sort-undecorate pattern.

I've seen proposals for an extension to list comprehension, which would 
be quite nice:

   [s for s in lst sortby s.lower()]

It reads nicely, and avoids lambdas and tiny helper functions.  Also 
handles the sort-returns-None criticism.  But it adds syntax.  And 
since it's not an in-place sort it won't perform as well (but probably 
better than the decorator idiom anyway...?)

--
Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org


More information about the Python-Dev mailing list

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