subclass list

Jason Orendorff jason at
Mon Feb 11 23:08:53 CET 2002

Mark McEahern writes:
> Q:  How do I override append() so that I can determine whether to add the
> value or not?
> I tried:
>   def append(self, value):
>       if not self.unique or (self.unique and not
>           list.append(value)
>           if self.unique:
>               self.keys[value] = None

list.append(self, value)
super(Bucket, self).append(value)

More on super:

## Jason Orendorff

More information about the Python-list mailing list