Sub-sort after sort
KeefTM
keeftm at gmail.com
Fri Nov 2 18:53:37 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.
I'm using Python 2.4 and I thought that was the first thing I tried.
Let me verify. Thanks!
More information about the Python-list
mailing list