title: Python introspection: get the argument list of a method_descriptor?
body: <p>A code illustration as an intro to my questions:</p>
  
  <pre><code>import re, inspect, datetime
  
  inspect.getargspec (re.findall)
  # =&gt;
  # ArgSpec(args = ['pattern', 'string', 'flags'], varargs=None,
  # keywords=None, defaults = (0,))
  
  type (datetime.datetime.replace)
  # =&gt; &lt;type 'method_descriptor'&gt;
  
  inspect.getargspec (datetime.datetime.replace)
  # =&gt; Traceback (most recent call last):
  #      File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  #      File "/usr/lib/python2.7/inspect.py", line 816, in getargspec
  #        raise TypeError('{!r} is not a Python function'.format(func))
  # TypeError: &lt;method 'replace' of 'datetime.datetime' objects&gt; is
  # not a Python function
  </code></pre>
  
  <p>It seems that the only way for me to find the signature of <code>datetime.datetime.replace</code> while I code is to look it up in <a href="https://docs.python.org/2/library/datetime.html#datetime.date.replace" rel="noreferrer">the doc</a>: <code>date.replace(year, month, day)</code>.</p>
  
  <p>The only introspection part that seems to work:</p>
  
  <pre><code>datetime.datetime.replace.__doc__
  # =&gt; 'Return datetime with new specified fields.'
  </code></pre>
  
  <p>I've examined how the Jupyter function arglist tool-tip works, they have the exact same problem, i.e. no arglist available for <code>datetime.datetime.replace</code>.</p>
  
  <p>So here are the questions:</p>
  
  <ol>
  <li><p>Is it still possible to get the argument list somehow? Maybe I could install the C sources for <code>datetime</code> and connect them via the <code>__file__</code> attribute?</p></li>
  <li><p>Is it possible to annotate a <code>&lt;type 'method_descriptor'&gt;</code> with the arglist information? In that case, I could parse the linked doc's markdown definition and automatically annotate the built-in module functions.</p></li>
  </ol>