Skip to content

gh-142518: Document thread-safety guarantees of set objects#145225

Open
lysnikolaou wants to merge 1 commit intopython:mainfrom
lysnikolaou:set-thread-safety
Open

gh-142518: Document thread-safety guarantees of set objects#145225
lysnikolaou wants to merge 1 commit intopython:mainfrom
lysnikolaou:set-thread-safety

Conversation

@lysnikolaou
Copy link
Member

@lysnikolaou lysnikolaou commented Feb 25, 2026

.. code-block::
:class: good

s.copy() # returns a shallow copy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be good to mention that set.copy is always atomic

The update variants of the above methods also have some differences between
them:

* :meth:`set.difference_update` and :meth:`set.intersection_update` try
Copy link
Contributor

@kumaraditya303 kumaraditya303 Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks confusing as what objects are locked at a time. It would good to clarify if objects are locked one-by-one or at once.

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

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants