I'm not a python programmer so hence coming here..
I'm aware cmp has been depreciated in python3, I'm trying to migrate this python 2 code to python3, I would appreciate some help.
def get_datalink_points( drivers ):
points = []
for driver in drivers:
points += driver.points
def compare_datalink_target( a, b ):
target_a = target_b = ''
if a.datalink is not None:
target_a = a.datalink.target
if b.datalink is not None:
target_b = b.datalink.target
return cmp( target_a, target_b )
return sorted( points, cmp = compare_datalink_target )
This code currently generates the following Error:
Exception Type: TypeError
Exception Value: 'cmp' is an invalid keyword argument for sort()
Thanks for any help.