Suppose I have the following function that is documented in the Numpydoc style, and the documentation is auto-generated with the Sphinx autofunction directive:
def foo(x, y, _hidden_argument=None):
"""
Foo a bar.
Parameters
----------
x: str
The first argument to foo.
y: str
The second argument to foo.
Returns
-------
The barred foo.
"""
if _hidden_argument:
_end_users_shouldnt_call_this_function(x, y)
return x + y
I don't want to advertise the hidden argument as part of my public API, but it shows up in my auto-generated documentation. Is there any way to tell Sphinx to ignore a specific argument to a function, or (even better) make it auto-ignore arguments with a leading underscore?