Thread
:
sorting by position
View Single Post
#
3
03-26-2008, 11:32 AM
farshizzo
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])
farshizzo
View Public Profile
Find all posts by farshizzo