gh-101100: Fix Sphinx warnings in turtle module#102340
Conversation
There was a problem hiding this comment.
Some top-level comments (some also reflected in individual suggestions):
- The
turtle.*callables are actually documented as module-level functions, rather than class-level methods on their specific class. ISTM that they should ideally be primarily documented as methods of their particular class, to be clear and explicit where each comes from and their recommended usage pattern, but I'm still working on a clean way to redirect these to avoid breaking existing references. So, at least for now the current definitions will have to do, but I would suggest at least using the correct role (funcrather thanmeth), and omitting theturtlewhich implies they are methods of aturtleclass (rather than their actual class. - Particularly in places where the actual class name is used, instead of erasing that information, I suggest instead making that the explicit title of the reference. Then, readers still have that info, and we can more easily go back later to have it point to the class if we end up moving and directing things.
- If you use
currentmodulewhere indicated, you can revert most of the noisy changes below that line.
Sorry, something went wrong.
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
|
Thank you for the review! Remaining warnings: $ make -C Doc html SPHINXERRORHANDLING=-n 2>&1 | grep turtle.rst | tee >(wc -l)
/Users/huvankem/github/cpython/Doc/library/turtle.rst:58: WARNING: py:class reference target not found: tkinter.Canvas
/Users/huvankem/github/cpython/Doc/library/turtle.rst:75: WARNING: py:class reference target not found: Pen
/Users/huvankem/github/cpython/Doc/library/turtle.rst:1: WARNING: py:class reference target not found: tkinter.Canvas
/Users/huvankem/github/cpython/Doc/library/turtle.rst:1: WARNING: py:class reference target not found: tkinter.Canvas
4 |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks! I had some follow-up suggestions mostly related to the second point above,
Particularly in places where the actual class name is used, instead of erasing that information, I suggest instead making that the explicit title of the reference. Then, readers still have that info, and we can more easily go back later to have it point to the class if we end up moving and directing things.
In particular, a number of them didn't actually make sense anymore when the prose and reference text no longer referred to the class/method.
Sorry, something went wrong.
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
CAM-Gerlach
left a comment
There was a problem hiding this comment.
LGTM, thanks @hugovk !
Sorry, something went wrong.
|
Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
|
Sorry @hugovk, I had trouble checking out the |
Sorry, something went wrong.
|
Thank you for all the reviews! |
Sorry, something went wrong.
) (cherry picked from commit 78e4e6c) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
|
Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
) (cherry picked from commit 78e4e6c) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
…nGH-102340) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> (cherry picked from commit 78e4e6c) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Fixes 36 Sphinx warnings.
Before
After
I think the
tkinter.Canvasones are valid because I don't seeCanvasin https://github.com/python/cpython/blob/main/Doc/library/tkinter.rstAnd I'm not sure how to deal with
turtle.Pen, it's defined like:cpython/Lib/turtle.py
Line 3836 in 880437d
where:
cpython/Lib/turtle.py
Line 3816 in 880437d