Sub-sort after sort

KeefTM keeftm at gmail.com
Fri Nov 2 19:02:56 EDT 2007


On Nov 2, 3:36 pm, "Andrew Koenig" <a... at acm.org> wrote:
> <kee... at gmail.com> wrote in message
>
> news:1194039935.380959.254770 at i13g2000prf.googlegroups.com...
>
> > I would want to sort by name first, then sub sort by location. Any
> > ideas? Thanks!
>
> In Python 2.3 and later, sorting is stable -- so you can sort successively
> in reverse order.  In other words, sort the list by location, then sort the
> sorted result again by name and you should get what you want.

That was it. I must of made a mistake when I tried it before. Thanks!




More information about the Python-list mailing list