title: Python profiler usage with objects
body: <p>I have a specific question regarding the usage of profiler. I am new to python programming
  I am trying to profile a function which I want to invoke as a class method, something like this</p>
  
  <pre><code>import profile
  
  class Class:
      def doSomething():
          do here ..
  
      def callMethod():
          self.doSomething()
  </code></pre>
  
  <p>instead of this I want to use </p>
  
  <pre><code>    profile.run(self.doSomething())
  </code></pre>
  
  <p>but the <code>profile.run</code> expects the string inside it and I get error</p>
  
  <pre><code>TypeError: exec: arg 1 must be a string, file, or code object
  </code></pre>
  
  <p>Can somebody please help?</p>
  
  <p>Thank you</p>