Код: Выделить всё
class Ulist(UserList):
def __init__(self,value=[]):
UserList.__init__(self)
self.value = value
def __add__(self,addvalue):
for x in addvalue:
if x in self.value:
print("It already exists")
else:
return self.value.__add__(addvalue)
Подробнее здесь: https://stackoverflow.com/questions/547 ... add-method
Мобильная версия