Object is not callable the second time I call a class method
<p>I have a class Match:</p>

<pre><code>class Match(object):

  def __init__(self,id):
      self.id = id

  def result(self):
      # somehow find the game result
      self.result = result
      return self.result
</code></pre>

<p>If I initialize a match object as</p>

<pre><code>m = Match(1)
</code></pre>

<p>when I call the method result I get</p>

<pre><code>m.result
Out[18]: &lt;bound method Match.result of &lt;football_uk.Match object at 0x000000000B0081D0&gt;&gt;
</code></pre>

<p>When I call it with the parenthesis, I get</p>

<pre><code>m.result()
Out[19]: u'2-3'
</code></pre>

<p>That is the correct answer. However, when I try to call a second, third, fourth, etc. time the method, I get</p>

<pre><code>m.result()
Traceback (most recent call last):

  File "&lt;ipython-input-20-42f6486e36a5&gt;", line 1, in &lt;module&gt;
m.result()

TypeError: 'unicode' object is not callable
</code></pre>

<p>If instead now I call the method without the parenthesis, it works:</p>

<pre><code>m.result
Out[21]: u'2-3'
</code></pre>

<p>The same with other similar methods.</p>

<p>You have given your instance an attribute named <code>result</code>:</p>

<pre><code>self.result = result
</code></pre>

<p>This now masks the method. You can't use the same name as the method if you don't want it masked. Rename the attribute or the method.</p>

<p>You could use the name <code>_result</code> for example:</p>

<pre><code>def result(self):
    # somehow find the game result
    self._result = result
    return self._result
</code></pre>

<p><code>self</code> is just another reference to the same object that <code>m</code> references. Attributes set or found on <code>self</code> are the same ones that you can find on <code>m</code>, because they are the same object. There is no difference between <code>m.result</code> and <code>self.result</code> here.</p>

python