sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.55k stars 2.12k forks source link

autodoc loses the first staticmethod parameter if the method is name mangled #9342

Open FlotterCodername opened 3 years ago

FlotterCodername commented 3 years ago

Describe the bug Static methods lose their first parameter in signature if they are also name mangled, i.e. __begins_like_this(). Similar to #4769 and #5032.

To Reproduce Please download my sample project and build the documentation

C:\> cd sphinx_private_static\docs
C:\sphinx_private_static\docs> sphinx-build Source Build

Expected behavior Parameter is not dropped from signature

Your project sphinx_private_static.zip

Environment info

@tk0miya This is my follow-up as requested in #9318. Thank you!

FlotterCodername commented 3 years ago

I can't post a screenshot from here, but here is the code in question:

@staticmethod
def __private_static(arg1, arg2):
    """

    :param arg1: I am missing from the signature! :(
    :param arg2:
    :return:
    """
    pass

And the HTML for the method:

__private_static(arg2)
Parameters
  • arg1 – I am missing from the signature! :(

  • arg2

Returns