title: Function for class exemplar
body: <p>I have something like that in my python code</p>
  
  <pre><code>class A:
    __mess = "Yeap!"
    def doSome(self):
      self.FN()
    def FN(self):
      pass
  
  def myFN(self):
    print self.__mess
  
  b = A()
  b.FN = myFN
  b.doSome()
  </code></pre>
  
  <p>But this doesn't work. Where am I wrong?</p>
  
  <p>python 2.6.5</p>
  
  <p>upd: I want to redefine method (FN) only for one exemplar (b).</p>
  
  <p>upd2:</p>
  
  <pre><code>import new
  class A:
    __mess = "Yeap!"
    def doSome(self):
      self.FN()
    def FN(self):
      pass
  
  def myFN(self):
    print self.__mess
  
  b = A()
  b.FN = new.instancemethod(myFN, b, A)
  b.doSome()
  </code></pre>
  
  <p>Doesn't work too.</p>
  
  <blockquote>
    <p>Traceback (most recent call last):<br>
    File "", line 1, in <br>
    File "", line 4, in doSome<br>
    File "", line 2, in myFN
    AttributeError: A instance has no
    attribute '__mess'</p>
  </blockquote>