May-25-2018, 10:23 AM
(This post was last modified: May-25-2018, 10:23 AM by sonicblind.)
Hi,
I have a list of class instances:
I know that the two instances with the name='n1' are in reality 2 different objects, so they are in reality not duplicates.
But for my project, having several instances with the same parameters means basically duplicates and I need to clean up the list accordingly.
Is there any easy way to do it?
Thanks.
I have a list of class instances:
mylist = [ myClass(name=n1), myClass(name=n2), myClass(name=n1), myClass(name=n3) ]How can I get rid of duplicates in this list?
I know that the two instances with the name='n1' are in reality 2 different objects, so they are in reality not duplicates.
But for my project, having several instances with the same parameters means basically duplicates and I need to clean up the list accordingly.
Is there any easy way to do it?
Thanks.