Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-133905: Fix parsing problems in example code #133906

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
Loading
from

Conversation

cmarqu
Copy link

@cmarqu cmarqu commented May 11, 2025

Fix problems in documentation example code snippets that prevent them from being parsed.


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

@python-cla-bot
Copy link

python-cla-bot bot commented May 11, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! Thank you!

We should totally add some plugin to parse our examples in the docs.

Doc/faq/programming.rst Outdated Show resolved Hide resolved
Doc/library/inspect.rst Outdated Show resolved Hide resolved
Doc/library/logging.rst Outdated Show resolved Hide resolved
Doc/library/test.rst Outdated Show resolved Hide resolved
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better to me! Let's wait for other opinions :)

Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this. Some of these clearly read better to me without the changes in this PR. I'm also hesistant that the motivation here is just to introduce a third party tool, whereas that tool could just be made more resilient.

A

@bedevere-app
Copy link

bedevere-app bot commented May 12, 2025

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@cmarqu
Copy link
Author

cmarqu commented May 12, 2025

The sphinx-codeautolink extension is resilient, but it will not put links in these unparseable code snippets.
The warnings it would produce by default can be handled easily with Sphinx' suppress_warnings.

Comment on lines 257 to 258
# do something
...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer a single line here and for most of the examples. Could do the revision with sed.

Suggested change
# do something
...
... # do something

Copy link
Author

@cmarqu cmarqu May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, there was indeed one such occurrence left, fixed. A follow-up PR could reformat all the examples consistently; this PR only works on the places where there were parsing problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.