On Thu, Aug 23, 2001 at 03:01:49PM +1200, Greg Ewing wrote: > Barry Scott <barry@scottb.demon.co.uk>: > > > How should all the variations be handled? > > def order(index = None, field = None, descending = 0): Lose the last arg... call them ascending() and descending(). Sorting already implies an "order" so that name is redundant >... > from sorting import order > > x.sort(order(index = 3)) > x.sort(order(field = "customer_name", descending = 1)) from sorting import ascending, descending x.sort(ascending(index = 3)) x.sort(descending(field = 'customer_name')) > The next step is to allow sort() itself to take the same > keyword parameters directly: > > x.sort(index = 3) > x.sort(field = "customer_name", descending = 1) eek... no :-) Cheers, -g -- Greg Stein, http://www.lyra.org/
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