Getting sorting order

leodp leodp at yahoo.com
Mon Jun 30 11:47:52 CEST 2008


> Or provide a better explanation and an example. Do you mean something like
> this?
>

Hi Peter,
a small example:

master=[1,4,3,2]
slave1=['d','c','b','a']
slave2=[1,2,3,4]

master.sort() # this is ok, but does not return infos on how the list
was sorted
slave1.sort(key=_maybe_something_here_referring_to_master_)
slave2.sort(key=_maybe_something_here_referring_to_master_)

Then I should get:
master=[1,2,3,4]
slave1=['d','a','b','c']
slave2=[1,4,3,2]


Hope it is more clear now.
Thanks, leodp



More information about the Python-list mailing list