title: Finding the filename and file path of a function in Python
body: <p>I have large number of python files where classes are also inheriting and overriding methods. I am tracking calls of the functions. Is there a way I can get the details of the function (where it is located in which file) without the actual call of the function (for example, just by passing object and function name)?</p>
  
  <p>Not to forget that objects are dynamic. So just listing all function names of the project isn't useful.</p>
  
  <p>File 1:</p>
  
  <pre><code>class ABC(DEF):
      def Start(self):
          pass
  </code></pre>
  
  <p>File 2:</p>
  
  <pre><code>class XYZ(DEF):
      def Start(self):
          pass
  </code></pre>
  
  <p>.</p>
  
  <p>.</p>
  
  <p>.</p>
  
  <p>File n:</p>
  
  <pre><code>class PQR(AQZ):
      def Activity(self):
          obj = ABC()
          # How to know in which file, the function Start is defined
          obj.Start()
  </code></pre>