Skip to content
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

:inherit: should show the source of the copied documentation #11089

Open
HertzDevil opened this issue Aug 13, 2021 · 1 comment
Open

:inherit: should show the source of the copied documentation #11089

HertzDevil opened this issue Aug 13, 2021 · 1 comment

Comments

@HertzDevil
Copy link
Contributor

Apparently #11065 is the only use of :inherit: in the standard library's documentation, and it turns out those defs do not have the "copied from" heading attached:

Screenshot_20210813_181427

Contrast with Tuple#to_a, which has no docs:

Screenshot_20210813_181541

A bare :inherit: merely makes this default behaviour explicit, so it should produce the "copied from" heading as well. For :inherit: followed by additional documentation in the overriding method I'm not so sure.

@straight-shoota
Copy link
Member

This behaviour is actually intended, see the original discussion in #6989

The idea is that :inherit: is an explicit decision to re-use the same documentation because it applies to the overriding method as well.
The note about inherited documentation is particularly relevant when the overriding method does not have any doc comment and the parent documentation is implicitly inherited. The notice makes it clear that the documentation is not written for this specific method and might not be accurate.

Using the same note for :inherit: would make it impossible to distinguish implicitly vs. explicitly inherited docs. I think it's important to show a difference.
Maybe there could be a different note. But I'm not sure if there is much benefit from showing that the documentation is inherited explicitly.

A link to the overridden method might be useful though in any case of overriding a method. Even if the overriding method has its own documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants