From: Raymond Hettinger [mailto:raymond.hettinger at verizon.net] > For Py2.4, I propose adding an optional list.sort() argument to > support the decorate-sort-undecorate pattern. [...] > def sort(self, cmpfunc=None, decorator=None): I like it! But "decorator" isn't a good name - it describes how it's being done, rather than what is being done. How about "key"? After all, "key=str.lower" reads more or less as "the key is the lowercase equivalent of the value", and "key=ages.__getitem__" reads "get the key by getting the appropriate item from the ages dictionary". But names apart, it's nice. It lets people use the builtin, without going for the performance-reducing comparison function... Paul.
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