Repository navigation
Update outdated linecache.getline() example - #163085
Conversation
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.
|
📖 2 files modified Preview · build overview · cpython-previews · built Dec. 3, 2026, 1:24 p.m. UTC |
|
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. |
|
no, there's no agent watching the repo and opening PRs automatically. I sometimes use an Al assistant (Claude Code) to help |
|
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. |
linecache.getline() example
|
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. |
|
GH-163087 is a backport of this pull request to the 3.15 branch. |
|
GH-163088 is a backport of this pull request to the 3.14 branch. |
|
@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 . |
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. |
The example in the
linecachedocs reads line 8 ofLib/linecache.pyand 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.