-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Automatically link inherited methods #11434
Comments
This is an expected behaviour. You need to include the inherited members as an autodoc option since otherwise |
Thank you very much for your tip that I could work around this by adding I can use |
I recall that you could actually document using |
yes, that does what I want. Thank you very much. |
Is there another trick to make To elaborate on your "most of the time": class Other:
def x() -> None:
pass but at least it gives a warning in that case. I have found the documentation for the dot syntax here. |
Now I remember why I removed this and re-implemented Since this is actually an expected behaviour, I would suggest you changing the title of your issue because it is more a feature that you request (namely "be able to implicitly reference something that is not documented"). |
I'd argue this is the right way of doing things, if you use an IDE it should find all mentions of the parent method when refactoring.
If instead you use the abbreviated form Per Google's Python style guide 3.8.3 unless there are side effects that need to be explicitly mentioned when a method is inherited there's no need to repeat its documentation in the child classes.
If someone decides to override a method in the child class they're responsible for updating the documentation, or to know the consequences of overriding a method defined in the parent class. If you write the cross-references explicitly the user is also constrained to refactor cross-references correctly. In conclusion when you say:
It is in fact more readable and easier to maintain overall. |
Describe the bug
Referencing a method defined in the parent class from a child class with
:meth:`x`
does not work.It looks as it should but there is no link.
As a workaround it is possible to reference the method in the parent class directly with
:meth:`~Parent.x`
but that is no solution because if someone decides to override that method in the child class all links will point to a wrong method.Issue #4600 looks related but there it was blamed on epytext which I am not using.
How to Reproduce
Environment Information
Sphinx extensions
['sphinx.ext.autodoc']
Additional context
No response
The text was updated successfully, but these errors were encountered: