Equality operator override problem
<p>I'm new to python, this is a class that I have</p>

<pre><code>class Goal:
    def __init__(self, name, value):
        self.name = name
        self.value = value

    def is_fulfilled(self):
        return self.value == 0

    def fulfill(self, value):
        if(self.value &lt; value):
            value = self.value

        self.value -= value

    def debug(self):
        print "-----"
        print "#DEBUG# Goal Name: {0}".format(self.name)
        print "#DEBUG# Goal Value: {0}".format(self.value)
        print "-----"

    def __eq__(self, other):
        return self.name == other.name
</code></pre>

<p>When I do</p>

<pre><code>if(goal1 == goal2):
    print "match"
</code></pre>

<p>it raises this error</p>

<pre><code>File "/home/dave/Desktop/goal.py", line 24, in __eq__
    return self.name == other.name
AttributeError: 'str' object has no attribute 'name'
</code></pre>

<p>What am I doing wrong here?</p>
