title: Python: How to call unbound method with other type parameter?
body: <pre><code>Python 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)
  [GCC 4.4.1] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; class A(object):
  ...     def f(self):
  ...             print self.k
  ...
  &gt;&gt;&gt; class B(object):pass
  ...
  &gt;&gt;&gt; a=A()
  &gt;&gt;&gt; b=B()
  &gt;&gt;&gt; a.k="a.k"
  &gt;&gt;&gt; b.k="b.k"
  &gt;&gt;&gt; a.f()
  a.k
  &gt;&gt;&gt; A.f(a)
  a.k
  &gt;&gt;&gt; A.f(b)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: unbound method f() must be called with A instance as first argument (got B instance instead)
  &gt;&gt;&gt;
  </code></pre>
  
  <p>How can I do this?</p>
  
  <p>Edited:this example is more clear</p>