Hi,

autodoc does not support such feature. It is difficult to guess "*args"
equals to "parent_argument". I'm welcome if you have good idea to realize
it. contributions are always welcome :-)

Thanks,
Takeshi KOMIYA

2020年3月4日(水) 3:25 Connor McClellan <[email protected]>:

> I have been trying to use Sphinx-autodoc to have my child classes __init__
> inherit the arguments of their parent classes __init__.  This would
> essentially replace the *args argument in the child docstring with the
> arguments of the parent.
>
> Python code:
>
> class Parent(object):
>
>    def __init__(self, parent_argument):
>       """
>       Parent class
>       Args:
>           parent_argument (int): Argument of the parent.
>       """
>       self.arg1 = parent_argument
>
>
> class Child(Parent):
>
>     def __init__(self, child_argument, *args):
>         """
>         Child class
>         Args:
>             child_argument (int): Argument of the child
>             *args:
>         """
>         super().__init__(*args)
>         self.arg2 = child_argument
>
> and the resulting docs would like this:
>
>
> Is this currently possible with autodoc?
>
> Thanks,
> Connor
>
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sphinx-users/e0b075a1-e979-40d4-8b2f-52daab5dff36%40googlegroups.com
> <https://groups.google.com/d/msgid/sphinx-users/e0b075a1-e979-40d4-8b2f-52daab5dff36%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CAFmkQANtth-MF-gUxohMWrJoqJ%3DSr2FU8OstddO39bgbTZKAHA%40mail.gmail.com.

Reply via email to