GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-134918: Fix and improve doctest's documentation by serhiy-storchaka · Pull Request #134919 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented May 30, 2025 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Fix and improve doctest's documentation #134918

📚 Documentation preview 📚: https://cpython-previews--134919.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka
serhiy-storchaka requested review from a team and tim-one May 30, 2025 08:35
@serhiy-storchaka serhiy-storchaka added docs Documentation in the Doc dir skip news needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels May 30, 2025
@github-project-automation github-project-automation Bot added this to Docs PRs May 30, 2025
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs May 30, 2025
@bedevere-app bedevere-app Bot added the awaiting core review label May 30, 2025
@bedevere-app bedevere-app Bot mentioned this pull request May 30, 2025
Fix and improve doctest's documentation #134918
Closed
@serhiy-storchaka
pythongh-134918: Fix and improve doctest's documentation
1c9791a
@serhiy-storchaka
serhiy-storchaka force-pushed the doctest-docs branch from bdcf54a to 1c9791a Compare May 30, 2025 09:18
@serhiy-storchaka

serhiy-storchaka commented May 30, 2025

Copy link
Copy Markdown
Member Author

@tim-one, please look at the floating point examples.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead
gpshead approved these changes May 30, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels May 30, 2025
bskinn
bskinn reviewed May 30, 2025
View reviewed changes
Comment thread Doc/library/doctest.rst
the same file as the module, or separated out into a separate test file.

* Define a ``__test__`` dictionary mapping from regression test topics to
* Define a :attr:`~module.__test__` dictionary mapping from regression test topics to

@bskinn bskinn May 30, 2025

Copy link
Copy Markdown
Contributor

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.

Should this be a Sphinx cross-reference? Seems like it shouldn't; I wouldn't think module.__test__ is a valid cross-ref target within the Python docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@picnixz picnixz May 30, 2025

Copy link
Copy Markdown
Member

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.

It refers to the attribute module.__test__ that was added in this PR as well: https://github.com/python/cpython/pull/134919/files#diff-035fbece7e3400413ea9a79196a2e96e0d6c9b5ed92ab8f5285c0600f7d325caR314.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bskinn bskinn May 30, 2025

Copy link
Copy Markdown
Contributor

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.

Ah, interesting, I see how that's set up now, thanks.

Isn't this an "off-label" (no pun intended) use of attribute, though? I would expect this to be implemented using a label. It seems odd that an attribute would link to something other than the API docs for (in this case) what would be module.__test__.

I see the benefit here, in that it results in __test__ being monospace-formatted. But it seems like a semantic mismatch to me.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@picnixz picnixz May 30, 2025

Copy link
Copy Markdown
Member

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.

We can say that this attribute may or may not exist, and dunder names are technically reserved for the language so I'm ok with this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bskinn reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@bskinn bskinn May 30, 2025

Copy link
Copy Markdown
Contributor

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.

Makes sense, I'm good with it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@serhiy-storchaka serhiy-storchaka May 30, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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.

Yet one benefit is adding "__test__ (module attribute)" in the index.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bskinn
bskinn approved these changes May 30, 2025
View reviewed changes
@serhiy-storchaka
serhiy-storchaka merged commit 3c66e59 into python:main May 31, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label May 31, 2025
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs May 31, 2025
@miss-islington-app

miss-islington-app Bot commented May 31, 2025

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 31, 2025
@serhiy-storchaka @miss-islington
pythongh-134918: Fix and improve doctest's documentation (pythonGH-13…
ea47c9c
…4919)

(cherry picked from commit 3c66e59)

Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 31, 2025
@serhiy-storchaka @miss-islington
pythongh-134918: Fix and improve doctest's documentation (pythonGH-13…
d9c4ec0
…4919)

(cherry picked from commit 3c66e59)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app

bedevere-app Bot commented May 31, 2025

Copy link
Copy Markdown

GH-134966 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label May 31, 2025
@bedevere-app

bedevere-app Bot commented May 31, 2025

Copy link
Copy Markdown

GH-134967 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label May 31, 2025
@serhiy-storchaka
serhiy-storchaka deleted the doctest-docs branch May 31, 2025 09:04
serhiy-storchaka added a commit that referenced this pull request May 31, 2025
@miss-islington @serhiy-storchaka
[3.14] gh-134918: Fix and improve doctest's documentation (GH-134919) (…
aceb504
…GH-134966)

(cherry picked from commit 3c66e59)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this pull request May 31, 2025
@miss-islington @serhiy-storchaka
[3.13] gh-134918: Fix and improve doctest's documentation (GH-134919) (…
366a790
…GH-134967)

(cherry picked from commit 3c66e59)

Co-authored-by: Serhiy Storchaka <[email protected]>
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@serhiy-storchaka @Pranjal095
pythongh-134918: Fix and improve doctest's documentation (pythonGH-13…
5857459
…4919)
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@serhiy-storchaka @taegyunkim
pythongh-134918: Fix and improve doctest's documentation (pythonGH-13…
76235de
…4919)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz left review comments
@gpshead gpshead gpshead approved these changes
@tim-one tim-one Awaiting requested review from tim-one
+1 more reviewer
@bskinn bskinn bskinn approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

Docs PRs
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@serhiy-storchaka @gpshead @picnixz @bskinn
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.