gh-101100: Fix sphinx warnings in enum module#101122
Conversation
There was a problem hiding this comment.
In general, unfortunately none of these changes are actually the correct fix, and many are in fact regressions. Some common themes:
- Method/attribute names should use be
literal, not italic (reserved for parameters), and genericobjectmethods/attributes can be either linked with:meth:`~object.__dunder__`, or unlinked with:meth:`!__dunder__`(see the reST markup quick reference in the devguide) - If the ref target actually exists,
!should not be used unless it would be repeating the same link within the same information unit (paragraph, description block, etc—see python/docs-community#52 ) - If the ref target does not and should not exist, and the original usage did not prefix a method, attribute, etc. name with the class or module it belongs to, and it is unambiguous in context, then it shouldn't be added when making it an unresolved reference (see python/docs-community#52 again)
- If the ref target does not exist, but potentially should be documented, then it is a valid warning that should either be documented or left as-is a rather than silenced (see what we did in
sqlite3).
Etc., see individual comments on each change for more details and the suggested fixes to each.
Sorry, something went wrong.
|
Also, since this fixes a docs defect and would otherwise increase the change of merge conflicts when backporting other docs fixes, this should be backported as well, at least to 3.11 if not 3.10. To note, the 3.10 backport will likely hit a conflict on one of the lines that's 3.11-specific, but that can be backported manually or with Cherry-Picker. |
Sorry, something went wrong.
|
@CAM-Gerlach thanks a lot for teaching me this! It makes so much more sense now. |
Sorry, something went wrong.
CAM-Gerlach
left a comment
There was a problem hiding this comment.
A few followup suggestions.
(Standard reminder: You can apply the suggestions you want in one go with Files changed -> Add to batch -> Commit, or modify them/add your own and do the same)
Sorry, something went wrong.
|
I'm so glad it was helpful to you! I was pretty worried that I was too harsh and critical with the tone of my comment, but I'm glad you learned a lot—that's as if not more important than fixing these issues, as it benefits everyone going forward! |
Sorry, something went wrong.
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
ethanfurman
left a comment
There was a problem hiding this comment.
Looks good, thank you both!
Sorry, something went wrong.
|
The enum docs were completely redone in 3.11, so there's no backporting to 3.10. |
Sorry, something went wrong.
|
Thanks @sobolevn for the PR, and @ethanfurman for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
* pythongh-101100: [Enum] Fix sphinx warnings in (cherry picked from commit 9e025d3) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
There were several warnings before:
Here's how these places were rendered:
After the fix, there are no warnings: