How to extract signature from function reference in Python?
<p>Let's say I have a function in Python like so:</p>

<pre><code>def foo(x): pass
</code></pre>

<p>According to Python, 'foo' alone is a function reference, right?</p>

<pre><code>&gt;&gt;&gt; def foo(x): pass
...
&gt;&gt;&gt; foo
&lt;function foo at 0xb7f3d1b4&gt;
</code></pre>

<p>Is there any way I can examine the function reference to determine the number of arguments it expects?</p>
