title: How to test if a class attribute is an instance method
body: <p>In Python I need to efficiently and generically test whether an attribute of a class is an instance method. The inputs to the call would be the name of the attribute being checked (a string) and an object.</p>
  
  <p>hasattr returns true regardless of whether the attribute is an instance method or not.</p>
  
  <p>Any suggestions?</p>
  
  <hr>
  
  <p>For example:</p>
  
  <pre><code>class Test(object):
      testdata = 123
  
      def testmethod(self):
          pass
  
  test = Test()
  print ismethod(test, 'testdata') # Should return false
  print ismethod(test, 'testmethod') # Should return true
  </code></pre>