sorting dictionary keys?

Serge Orlov sombDELETE at pobox.ru
Sun Nov 30 05:21:32 EST 2003


"Bruno Desthuilliers" <bdesth.nospam at removeme.free.fr> wrote in message news:3fc935da$0$28643$636a55ce at news.free.fr...
> 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.
Why ugly? It adds the functionality you asked for, it doesn't
use any magic, it's readable. I have goodies.py module for
personal stuff like that.

>
> I just can't understand *why* the BDFL made this choice.
The answer is the FAQ section of the Python web site.

-- Serge.






More information about the Python-list mailing list