Skip to content

_thread module docs: remove/update certain bullet points in the *caveats* list #125025

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

Closed
zuo opened this issue Oct 6, 2024 · 1 comment
Closed
Assignees
Labels
docs Documentation in the Doc dir

Comments

@zuo
Copy link
Contributor

zuo commented Oct 6, 2024

Documentation

Near the end of the documentation of the _thread module there is a list of caveats. It looks like it was written a long time ago and some of its items seem no longer accurate...

We can read that:

  • [in the first bullet point]

    Threads interact strangely with interrupts: the KeyboardInterrupt exception will be received by an arbitrary thread. (When the signal module is available, interrupts always go to the main thread.)

    whereas it seems that nowadays we could replace that text with a much simpler statement:

    Interrupts always go to the main thread (the KeyboardInterrupt exception will be received by that thread).

  • [in the last bullet point]

    When the main thread exits, it does not do any of its usual cleanup (except that tryfinally clauses are honored), and the standard I/O files are not flushed.

    whereas it seems just not true anymore. I believe this bullet point should be removed entirely.

Here, I address a request to a core developer who is an expert in threading to confirm or correct my change suggestions presented above. [EDIT: see the related PR]


See also: https://discuss.python.org/t/are-all-descriptions-of-the-caveats-listed-near-the-end-of-thread-modules-docs-up-to-date/55261/18 (this response by @eryksun is concise and clear, so I suggest TL;DR-readers to focus on it – as some other parts of that discussion thread are not well focused on the questions from the original post).

Linked PRs

@zuo zuo added the docs Documentation in the Doc dir label Oct 6, 2024
zuo added a commit to zuo/cpython that referenced this issue Oct 6, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 6, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 6, 2024
@gpshead gpshead self-assigned this Oct 6, 2024
@gpshead
Copy link
Member

gpshead commented Oct 6, 2024

Thanks! merged & doc backports are on their way.

@gpshead gpshead closed this as completed Oct 6, 2024
gpshead pushed a commit that referenced this issue Oct 6, 2024
…25026) (GH-125031)

gh-125025: `_thread` docs: fix/update the *caveats* list (GH-125026)
(cherry picked from commit 1e098dc)

Co-authored-by: Jan Kaliszewski <[email protected]>
Yhg1s pushed a commit that referenced this issue Oct 7, 2024
…25026) (#125032)

gh-125025: `_thread` docs: fix/update the *caveats* list (GH-125026)
(cherry picked from commit 1e098dc)

Co-authored-by: Jan Kaliszewski <[email protected]>
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
Projects
None yet
Development

No branches or pull requests

2 participants