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
gh-109510: Clearly explain "Which Docstrings Are Examined" #109696
Conversation
The "Which Docstrings Are Examined" part of Doctest documentation is ambiguos, This change explained it cleary with an example.
Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@python/proofreaders, could we take a look here? |
Can you clarify your proofreading ask here, @zware? If I read the thread right, the new content is not done yet, and the advice being sought is w.r.t. what to include, not how to write/format it. |
Sorry, could have clarified :). I meant to request I recommended to @Unique-Usman to leave the further improvements to another PR rather than holding this one up. As such, I've marked the messages about further changes as 'off-topic'. |
thank @zware as you recommended, I will be creating a new PR for the further improvement. |
Doc/library/doctest.rst
Outdated
The value of ``example.__test__["numbers"]`` value will be treated as | ||
docstring and all the tests inside it will be run. It is also | ||
important to note that the value can also be mapped to a Function, | ||
class object or module. If the value is a class, Function or module, doctest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class object or module. If the value is a class, Function or module, doctest | |
class object or module. If the value is a class, Function or module, :mod:`doctest` |
Do we link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. We use the appropriate role to get the appropriate formatting, but add !
to not resolve the link, since it is to the current module docs that the reader is already on, which isn't particularly helpful.
Co-authored-by: Jacob Coffee <jacob@z7x.org>
Co-authored-by: Jacob Coffee <jacob@z7x.org>
Changed doctest :mod: `doctest`
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for this. Looks good overall; I had some relatively modest feedback, all as suggestions you can apply. You can easily do so all in one go by going to Files
, clicking Add to batch
on each suggestion, and once done clicking Commit
. Thanks!
Accepted suggestions to meet python documentation convention Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
@CAM-Gerlach Thanks for this it really helped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, but I do have one last semi-substantive thing I'm confused on, which my previous changes ended up highlighting. Thanks!
Changed :samp:`{name of M}.__test__.K` to ``M.__test__.K`` as the M is already a placeholder for name of the module. Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Changed the `True` to "is true" to specify that ``M.__test__`` has a truthy value, rather than literally being True.
I have made the requested changes; please review again |
Changes "is true" to "is truthy" to imply that the value of ``M.__test__" has true value. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thanks @Unique-Usman for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
…honGH-109696) (cherry picked from commit bcc941b) Co-authored-by: Unique-Usman <86585626+Unique-Usman@users.noreply.github.com> Co-authored-by: Mariatta <Mariatta@users.noreply.github.com> Co-authored-by: Jacob Coffee <jacob@z7x.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
…honGH-109696) (cherry picked from commit bcc941b) Co-authored-by: Unique-Usman <86585626+Unique-Usman@users.noreply.github.com> Co-authored-by: Mariatta <Mariatta@users.noreply.github.com> Co-authored-by: Jacob Coffee <jacob@z7x.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
GH-111077 is a backport of this pull request to the 3.12 branch. |
GH-111078 is a backport of this pull request to the 3.11 branch. |
…-109696) (#111077) Co-authored-by: Unique-Usman <86585626+Unique-Usman@users.noreply.github.com> Co-authored-by: Mariatta <Mariatta@users.noreply.github.com> Co-authored-by: Jacob Coffee <jacob@z7x.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
…-109696) (#111078) Co-authored-by: Unique-Usman <86585626+Unique-Usman@users.noreply.github.com> Co-authored-by: Mariatta <Mariatta@users.noreply.github.com> Co-authored-by: Jacob Coffee <jacob@z7x.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
…hon#109696) Co-authored-by: Mariatta <Mariatta@users.noreply.github.com> Co-authored-by: Jacob Coffee <jacob@z7x.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
The "Which Docstrings Are Examined" part of
Doctest documentation is ambiguos, This change explained it cleary with an example.
📚 Documentation preview 📚: https://cpython-previews--109696.org.readthedocs.build/en/109696/library/doctest.html#which-docstrings-are-examined