I am trying to decode/understand a python script, I have this line:
sorted_list = [ i for i in sorted(my_list,key=lambda x: x.ram_address if x.ram_address != None else None) if i.ram_address != None]
with next error message:
'<' not supported between instances of 'NoneType' and 'int'
I kind understand that because the function "sorted" is trying to do some comparison '<' in order to sort the list, and I might have some 'none' values
Can you help me to understand the entire line what it does, and how can I solve the problem with None type and got the same result??, this problem rised in python 3.6, but there is no problem with python 2.6