I like "sort" better than "decorator"; I would also like "by", as in sort(names, by=ages.__getitem__). I would also advocate an optional reverse=False argument, so that result = sort(names, reverse=True) is equivalent to result = sort(names) result.reverse() > Date: Mon, 13 Oct 2003 15:34:15 -0400 > From: "Raymond Hettinger" <raymond.hettinger at verizon.net> > Subject: [Python-Dev] decorate-sort-undecorate > To: <python-dev at python.org> > Message-ID: <001f01c391c0$fcdb88a0$e841fea9 at oemcomputer> > Content-Type: text/plain; charset="us-ascii" > > For Py2.4, I propose adding an optional list.sort() argument to support > the decorate-sort-undecorate pattern. > > The current, pure Python approach to DSU is pure arcana. It is obscure > enough and cumbersome enough that cmpfunc() tends to get used instead. > > Built-in C support for DSU requires much less skill to use, results in > more readable code, and runs faster. > > Raymond Hettinger >
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