<p>When I call</p>

<pre><code>help(Mod.Cls.f)
</code></pre>

<p>(Mod is a C extension module), I get the output</p>

<pre>Help on method_descriptor:

f(...)
    doc_string</pre>

<p>What do I need to do so that the help output is of the form</p>

<pre>Help on method f in module Mod:

f(x, y, z)
    doc_string</pre>

<p>like it is for random.Random.shuffle, for example?</p>

<p>My PyMethodDef entry is currently:</p>

<pre><code>{ "f", f, METH_VARARGS, "doc_string" }
</code></pre>

You cannot. The inspect module, which is what 'pydoc' and 'help()' use, has no way of figuring out what the exact signature of a C function is. The best you can do is what the builtin functions do: include the signature in the first line of the docstring:
```
```
>>> help(range)
Help on built-in function range in module __builtin__:

range(...)
    range([start,] stop[, step]) -> list of integers

...
```
```
The reason random.shuffle's docstring looks "correct" is that it isn't a C function. It's a function written in Python.