title: Easy ways to investigate unknown Python APIs
body: <p>When studying a snippet of unknown Python code, I occasionally bump into the</p>
  
  <pre><code>varName.methodName()
  </code></pre>
  
  <p>pattern.</p>
  
  <p>To figure out what's this, I shall study the code more, find where varName was instantiated, find its type. So if <strong>varName</strong> proves to be an instance of <strong>ClassName</strong> class, I would knew that <strong>methodName()</strong> is a method of <strong>ClassName</strong>.</p>
  
  <p>Sometimes <strong>varName</strong> == <strong>self</strong> and <strong>methodName()</strong> is a method of this class, or a method inherited from some other class, if the current class is subclassing some other classes.</p>
  
  <p>Are there quick ways / tools that could take 'methodName' as input, scan over all installed Python modules and show which classes have <strong>methodName()</strong>?</p>
  
  <p>The closest thing related to this I know of is ipython. If I type a class name, then dot ('.') then TAB, it can show the class members. Instead of a class I could use a name of an object (which is an instance of a certain class) and it would work too. As soon as I choose a method name from the provided options, I can type '?' or '??' and get some help if there's a docstring.</p>
  
  <p>I wonder if ipython can do some intelligent scanning based only on 'methodName' string.</p>
  
  <p>If you know alternatives to ipython that could possibly help with this, please do suggest them.</p>
  
  <p>Edit: as requested, I'm explicitly adding that I would like a way to find methods by method names <strong>not only</strong> in Python source code files. Some Python packages (notably PyQt) contain a lot of .so files, and ipython is able to do completions by presumably importing them first. So a plain text search like grep (or even ctags) won't do the trick here.</p>