Very basic, sorting a list ???

Stef Mientki S.Mientki-nospam at mailbox.kun.nl
Thu Nov 29 04:40:38 EST 2007


Peter Decker wrote:
> On Nov 28, 2007 7:22 PM, stef mientki <stef.mientki at gmail.com> wrote:
>>     print 'xx3',ordered_list.sort()
> 
> The sort() method returns None. It sorts the list in place; it doesn't
> return a copy of the sorted list.
> 
Thank you all for the answers,
I do understand now,
although I find it rather non-intuitive.
I didn't expect a copy, but a reference to itself wouldn't be asked too much ?
Why does it return None, instead of the sorted object itself ?
I guess it would cost almost exactly the same processing power.

cheers,
Stef Mientki



More information about the Python-list mailing list