Ian Bicking <ianb at colorstudy.com>: > Okay, really I'm just hoping for [x for x in l sortby key(x)], if > not now then someday -- if only there was a decent way of expressing > that without a keyword... [...in l : key(x)] is the only thing I can > think of that would be syntactically possible (without introducing a > new keyword, new punctuation, or reusing a wholely inappropriate > existing keyword). [x >> key(x) for x in l] # ascending sort [x << key(x) for x in l] # descending sort (Well, we got print >> f, so it was worth a try...) Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg at cosc.canterbury.ac.nz +--------------------------------------+
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