On Wed, 2003-10-15 at 13:52, Guido van Rossum wrote: > > While we're hacking on [].sort(), how horrible would it be if we > > modified it to return self instead of None? > > -1000. This is non-negotiable. Sniff. >>> class mylist(list): ... def sort(self, *args, **kws): ... super(mylist, self).sort(*args, **kws) ... return self ... >>> mylist([5, 4, 3, 2, 1]) [5, 4, 3, 2, 1] >>> x = mylist([5, 4, 3, 2, 1]) >>> x.sort() [1, 2, 3, 4, 5] Bliss. -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 307 bytes Desc: This is a digitally signed message part Url : http://mail.python.org/pipermail/python-dev/attachments/20031015/d011f721/attachment.bin
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