sorting dictionary keys?

Bruno Desthuilliers bdesth.nospam at removeme.free.fr
Sat Nov 29 19:29:11 EST 2003


Serge Orlov wrote:
>><rant>
>>Which is one of the main PITA in Python IMHO :(
>>(not the fact that it sort in place, the fact that it does not return self).
>></rant>
> 
> 
> <hint>
> def sort(lst):
>     lst.sort()
>     return lst
> </hint>

Which is pretty ugly and adds a useless function call.

I just can't understand *why* the BDFL made this choice.





More information about the Python-list mailing list