Skip to content

gh-148589: Clarify PyThreadState_GetFrame thread state requirement#153516

Closed
zainnadeem786 wants to merge 1 commit into
python:mainfrom
zainnadeem786:docs/threadstate-getframe-current-thread
Closed

gh-148589: Clarify PyThreadState_GetFrame thread state requirement#153516
zainnadeem786 wants to merge 1 commit into
python:mainfrom
zainnadeem786:docs/threadstate-getframe-current-thread

Conversation

@zainnadeem786

Copy link
Copy Markdown
Contributor

Summary

Clarify that PyThreadState_GetFrame() expects the supplied thread state to be the thread state attached to the current OS thread.

This follows the maintainer discussion in GH-148589 and matches the glossary definition of an attached thread state.

This is a documentation-only change. No runtime behavior is changed.

Close: gh-148589

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33531406 | 📁 Comparing a14b604 against main (c98e984)

  🔍 Preview build  

1 file changed
± c-api/threads.html

@ZeroIntensity

Copy link
Copy Markdown
Member

I've asked you before to please use your own critical thinking when using an AI agent to triage issues and/or make PRs. This change deviates from the wording of every other PyThreadState_* API and only restates the content of the "attached thread state" term.

@zainnadeem786

Copy link
Copy Markdown
Contributor Author

Hi @ZeroIntensity,

I'd like to clarify one point. I don't think it's fair to assume that I rely on AI instead of my own reasoning. I do use AI as a research and drafting aid at times, but I review, verify, and take responsibility for everything I submit.

If there was a specific technical issue with this PR, I'd appreciate feedback on that rather than assumptions about how it was written. That would help me improve future contributions.

Thanks.

@zainnadeem786 zainnadeem786 deleted the docs/threadstate-getframe-current-thread branch July 10, 2026 16:21
@ZeroIntensity

Copy link
Copy Markdown
Member

If there was a specific technical issue with this PR, I'd appreciate feedback on that rather than assumptions about how it was written. That would help me improve future contributions.

I told you what the technical problems with this PR were. If you read my comment on the issue, you would understand why I don't believe this is the right change. I'm not saying you're not reviewing your work at all, but I am saying that you're not reviewing it enough. I urge you to review our AI policy before continuing to submit PRs.

For future contributions, please just do the work on your own merits, or otherwise significantly review your agent's output before sending it to us. AI is fine to use as an assistant or a reference, but it shouldn't handle every step of the process. Just because an agent can provide working code or a documentation change does not mean it has all the right context.

Sorry if this comes off as harsh, but this is a recurring pattern I've seen in your contributions. CPython is a volunteer-run project; we have nothing to gain by stopping you from using AI in your contributions, but we also have limited time. If you can effectively submit AI-generated contributions that are productive, we are happy to consider them, but otherwise, it is a waste of reviewer time and unfair to those who do put thoughtful research into their contributions.

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

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

PyThreadState_GetFrame() thread-safety is unclear (and inconsistent with sys._current_frames())

2 participants