View Single Post
  #3  
Old 03-26-2008, 11:32 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The best method is to use the key parameter instead of the cmp parameter. It is faster and more efficient. Here is some sample code:
Code:
list.sort(key = lambda x: x.getPosition()[1])
Reply With Quote