For example, I have a self defined class, like this:

```
 class Alarm(object):
        def __init__(self, alarmId, msg):
            self.alarmId = alarmId
            self.msg = msg

        def __eq__(self, other):
            return self.alarmId == other.alarmId

    aList = list()
    a = Alarm(1, "hello")
    b = Alarm(1, "good")
    aList.append(a)
    aList.append(b)

```

Alarms with same Id are considered same, so "a" and "b" is actually same. I want to check if same Alarm already exist in the list, if it already existed , then no need to add it to the list.

```
if a in aList: # I wish when this "in" called, I could call one member function of a to match the whole list
   pass 

```

But which function do I need to overwrite to do this? I tried `__eq__`, but it could not accomplish what I want.