I have a sort function in a python chess program.
Currently it looks like this:

def sortMoves (board, table, ply, moves):
    f = lambda move: getMoveValue (board, table, ply, move)
    moves.sort(key=f, reverse=True)
    return moves

However I'd really like not to use the lambda, as it slows down the code.

I've thought about saving the extra variables in the global space, but it 
really feals ugly.

Do you have any ideas how I can sort these moves the fastest?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to