On 22/07/2012 01:32, Steven D'Aprano wrote:
On Sat, 21 Jul 2012 20:40:46 +0100, MRAB wrote:On 21/07/2012 20:08, Lipska the Kat wrote:l=sorted(l, key=itemgetter(0))Short is: l.sort(key=itemgetter(0))Shorter, and the semantics are subtly different. The sorted function returns a copy of the input list. The list.sort method sorts the list in place.
Since the result is bound to the original name, the result is the same. -- http://mail.python.org/mailman/listinfo/python-list