title: Get parameter(arg) count of builtin functions in Python
body: <p>I wrote my own c-module for Python and for a custom table in a documentation <strong>I need the number of parameters of the builtin-functions during runtime</strong>.</p>
  
  <p>There are functions in Python 2 like <a href="https://docs.python.org/2/library/inspect.html#inspect.getargspec" rel="nofollow noreferrer">inspect.getargspec</a> or functions in Python 3 like <a href="https://docs.python.org/3/library/inspect.html#inspect.signature" rel="nofollow noreferrer">inspect.signature</a> which support normal Python functions, but leave builtin-functions unsupported.</p>
  
  <p>There are two other community solutions so far:</p>
  
  <ul>
  <li>Parsing the doc-strings</li>
  <li>Parsing the original *.c file</li>
  <li>See answer for third approach</li>
  </ul>
  
  <p>In some cases the docstrings are outdated and/or it's hard to extract the argument count since the docstring can be any plain string. Parsing the original *.c file is a good approach as well, but you might not have access to it.</p>