Skip to content

Update outdated linecache.getline() example - #163085

Merged
picnixz merged 1 commit into
python:mainfrom
aliysnm:docs-linecache-example
Dec 3, 2026
Merged

picnixz merged 1 commit into
python:mainfrom
aliysnm:docs-linecache-example

Conversation

@aliysnm

@aliysnm aliysnm commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

The example in the linecache docs reads line 8 of Lib/linecache.py and expects 'import sys\n'. Since gh-157146, that line is the __all__ definition instead, so the example output is wrong.

This changes the example to read line 1 (the module docstring), which is much less likely to change when the module is edited.

Since pythongh-157146, line 8 of Lib/linecache.py is no longer 'import sys',
so the example output was wrong. Use line 1 (the module docstring),
which is much less likely to change.
@read-the-docs-community

read-the-docs-community Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

📖 2 files modified


Preview · build overview · cpython-previews · built Dec. 3, 2026, 1:24 p.m. UTC

@picnixz

picnixz commented Dec 3, 2026

Copy link
Copy Markdown
Member

Is there an automated agent that opens PRs whenever it's possible? because as soon you were able to create a new PR, it was done. This doesn't align with AI policy. Should this repeat, we will ban you from contributing to our repositories.

@picnixz picnixz closed this Dec 3, 2026
@aliysnm

aliysnm commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

no, there's no agent watching the repo and opening PRs automatically. I sometimes use an Al assistant (Claude Code) to help
prepare changes. I had prepared this fix this morning, and after you merged [#163063]
(#163063) and I was back under the open PR limit, I had the assistant open it. I can see
how that looked automated. I'll open PRs myself and at a slower pace from now on. Fine to keep this one closed.

@picnixz picnixz reopened this Dec 3, 2026
@picnixz

picnixz commented Dec 3, 2026

Copy link
Copy Markdown
Member

Thanks for clarifying, I'm reopening this one because it's fine but please don't let agents run automatically. This will grow the backlog way too fast and this will count as a spam.

@picnixz picnixz added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Dec 3, 2026
@picnixz picnixz changed the title Docs: Update outdated linecache.getline() example Update outdated linecache.getline() example Dec 3, 2026
@picnixz

picnixz commented Dec 3, 2026

Copy link
Copy Markdown
Member

To be precise: you can ask the agent to open it, but don't have it automatically open it whenever you can. I'm fine with fast-merging those fixes because they impact docs examples and not just wording which IMO are more important to be correct at any time. But for other kind of PRs, we would have a different workflow.

@picnixz
picnixz enabled auto-merge (squash) December 3, 2026 13:27
@picnixz
picnixz merged commit ca89a7e into python:main Dec 3, 2026
74 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Dec 3, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @aliysnm for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Dec 3, 2026

Copy link
Copy Markdown

GH-163087 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Dec 3, 2026
@bedevere-app

bedevere-app Bot commented Dec 3, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Dec 3, 2026
picnixz pushed a commit that referenced this pull request Dec 3, 2026
…3087)

Update outdated `linecache.getline()` example (GH-163085)
(cherry picked from commit ca89a7e)

Co-authored-by: Ali <105012194+aliysnm@users.noreply.github.com>
picnixz pushed a commit that referenced this pull request Dec 3, 2026
…3088)

Update outdated `linecache.getline()` example (GH-163085)
(cherry picked from commit ca89a7e)

Co-authored-by: Ali <105012194+aliysnm@users.noreply.github.com>
@thejesh23

thejesh23 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

@picnixz I know its easy to spam with lot of doc PR's but some are important as well to fix it as low reasoning LLM's tend to take a call based on docs if they are available , I see this behavior with sonnet or opus set at low reasoning level. Doc and knowledge files got more importance than ever more earlier for humans now for LLM's .
Should we think of a broader effort fix the doc issues one library at a time with some deep reasoning models checking for accuracy thoroughly ? this is help with reduce new PR's created on for docs.

@picnixz

picnixz commented Dec 3, 2026

Copy link
Copy Markdown
Member

Should we think of a broader effort fix the doc issues one library at a time with some deep reasoning models checking for accuracy thoroughly

Well, depends. WE definitely don't like very large PRs because it's hard to revert them if there are issues and if they span multiple files. So we usually accept focused docs PRs. For typos, we usually want all typos in the file being fixed (but not necessarily typos in the code). Here most of the PRs I merged were about REPL examples and across mulitple files. We can have a single round of PRs for those, either have 2-3 PRs depending on the areas that are touched and whether backports can be uniformly applied.

What I don't want: a flood of docs PRs. We just don't have the bandwidth. Today I had a small bandwidth for these docs because it's easy to check. When it comes to wording it takes more time to agree on what to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants