-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
More fully qualified argument types #26334
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
base: main
Are you sure you want to change the base?
Conversation
FWIW I find these rather noisy and would much rather use the short form as much as possible (just like you write |
That or don't put the "~" in, which suppressed the full path in the html docs? I actually think it's useful to spell these out, otherwise how does the user know how to spell the import? |
If reading the source code: check for the corresponding import at the top of the file (just like you would do if you see LineCollection in the source code). |
I think a fair bit of docs get read using an IDE, in which case I agree that clicking through in html is fine. |
Th proposed change reflects our current policy: https://matplotlib.org/devdocs/devel/document.html#reference-types I don't have a strong opinion on the plain text version. But if you want to change, the policy needs an update. |
I moved quite a lot of files from #26326 to here. Yes, this is what the docs say. |
We have 248 occurences of I'm inclined to merge this. However, there are a few cases in which the fully qualied name introduces wrapping into the docstring, which is quite disruptive and IMO isn't worth it. |
I don't have a strong opinion - just pointing out that full names are sometimes easier to parse, but I guess it depends how people usually use the docs. |
There are also two cases starting with For the HTML-version it is of course better with a short version, while when reading the source (and not being that used to the code base), the full path makes sense. I guess that is why the documentation states what it does. |
(I don't like fully qualifying the names everywhere in the docs, but won't block that if there's general agreement to do so.) |
We currently don’t do it everywhere. Fully qualified is only recommended for parameter type descriptions. I’m inclined to loosen the policy on this to “Use full references, but shorten the reference if this prevents a line break”. That way, we have the more precise info where it doesn’t really hurt legibility, and we don’t make the longer type descriptions even more busy. |
PR summary
PR checklist