i’m trying to create a class does not allow duplicate entryies
class QSet(list):
def __init__(self,*args):
super(QSet, self).__init__(args[0])
self=list(set(self))
and when try to test the class duplicated entries not removed
d=["a","b","a","z","a"]
z=QList(d)
print d
print z
any suggestion to solve this
Thanks
Reassigning
selfdoesn’t actually change the object (you’re just rebinding the identifierselfto a new object). You could change the line to: