Skip to content

GH-116738: document thread-safety of bisect#136555

Merged
nascheme merged 7 commits intopython:mainfrom
nascheme:gh-116738-bisect-threadsafe-doc
Jul 30, 2025
Merged

GH-116738: document thread-safety of bisect#136555
nascheme merged 7 commits intopython:mainfrom
nascheme:gh-116738-bisect-threadsafe-doc

Conversation

@nascheme
Copy link
Member

@nascheme nascheme commented Jul 11, 2025

I don't think it makes sense to make these functions thread-safe. They are already unsafe when used in the default build. And, given that they can operate on any sequence object, trying to lock the sequence object doesn't make sense.

I added a unit test because I believe these functions should not crash or produce TSAN warnings when they are used on a sequence being mutated in another thread.


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

Loading
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 news tests Tests in the Lib/test dir topic-free-threading

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants