Sphinx cross-reference function as default keyword argument in call signature

34 views Asked by At

Imagine I have a Python function called foobar with the following call signature:

def baz(x):
    return x + 1

def foobar(y, f=baz):
    return f(y)

Now I am using Sphinx with autodoc and napoleon to produce some documentation for this function. The call signature generated in the docs then looks something like:

foobar(y, f=<function baz>)

My question is: is there a way to make this a bit prettier, so that it just displays the name of the function? Or ideally a way to cross-reference baz?

0

There are 0 answers