title: Profiling self and arguments in python?
body: <p>How do I profile a call that involves self and arguments in python?</p>
  
  <pre><code>def performProfile(self):
      import cProfile
      self.profileCommand(1000000)
  
  def profileCommand(self, a):
      for i in a:
          pass
  </code></pre>
  
  <p>In the above example how would I profile just the call to profileCommand? I figured out I need to use runctx for argument, but how do I deal with self? (The code actually involves a UI, so it's hard to pull out the call to profile separately).</p>