On Wed, 2003-10-15 at 14:42, Mark Russell wrote: > I have a trivial wrapper function sortcopy() in my > I-wish-these-were-builtins module: > > def sortcopy(vals, cmpfunc=None): > """Non in-place wrapper for list.sort().""" > copy = list(vals) > copy.sort(cmpfunc) > return copy > > I use this more often than list.sort(), because most of the time > performance and memory use is not an issue and code using the in-place > version is irritatingly verbose. Maybe this is worth adding as a > builtin, to satisfy the people that want a non in-place sort. No. This is so easy to write, we're all destined to write it again and again <0.4 wink>. I also use sort(): def sort(L): L.sort() return L Jeremy
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