class practice:
    id = None

def __init__(self, id):
    self.id = id

def __lt__(self, other):
    return other.id > self.id

def __eq__(self, other):
    return self.id == other.id
How to remove duplicates in a nested list of objects in python