Did the discussion of a sort() expression get resolved? The last I remember was that the list.sorted() classmethod had won the most support because it accepted the broadest range of inputs. I could live with that though I still prefer the more limited (list-only) copysort() method. Raymond Hettinger > 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.
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