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?
_foofunction where the_hidden_parameterisn't hidden at all, though the documentation warns against the use of the_foofunction, and then afoowith only two parameters that simply calls_foowith the correct values. When you need the last parameter you use_fooand when you don't need it you usefoolike the end users.