Let's see what the use cases look like under the various proposals: todo = [t for t in tasks.copysort() if due_today(t)] todo = [t for t in list.sorted(tasks) if due_today(t)] todo = [t for t in list(tasks, sorted=True) if due_today(t)] genhistory(date, events.copysort(key=incidenttime)) genhistory(date, list.sorted(events, key=incidenttime)) genhistory(date, list(events, sorted=True, key=incidenttime)) for f in os.listdir().copysort(): . . . for f in list.sorted(os.listdir()): . . . for f in list(os.listdir(), sorted=True): . . . To my eye, the first form reads much better in every case. It still needs a better name though. [Phillip J. Eby in a separate note] > Wouldn't it need to grow key and cmpfunc, too? Now, that "key" and "reverse" are available, there is no need for "cmp" in any new methods. [Guido in a separate note] > list(range(10), reverse=True) > >would yield > > [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] > > But Raymond has a different proposal in mind for that (he still needs to > > update PEP 322 though). I'll get to it soon; there won't be any surprises. 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