File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -300,13 +300,8 @@ and will not corrupt the set:
300300 These operations also compare elements, so the same :meth: `~object.__eq__ `
301301considerations as above apply.
302302
303- The following operations return new objects and hold the per-object lock
304- for the duration:
305-
306- .. code-block ::
307- :class: good
308-
309- s.copy() # returns a shallow copy
303+ The :meth: `~set.copy ` method returns a new object and holds the per-object lock
304+ for the duration so that it is always atomic.
310305
311306The :meth: `~set.clear ` method holds the lock for its duration. Other
312307threads cannot observe elements being removed.
@@ -341,8 +336,8 @@ The update variants of the above methods also have some differences between
341336them:
342337
343338 * :meth: `set.difference_update ` and :meth: `set.intersection_update ` try
344- to lock all objects.
345- * :meth: `set.symmetric_difference_update ` only lock the argument if it is
339+ to lock all objects one-by-one .
340+ * :meth: `set.symmetric_difference_update ` only locks the arguments if it is
346341 of type :class: `set `, :class: `frozenset `, or :class: `dict `.
347342
348343The following methods always try to lock both objects:
You can’t perform that action at this time.
0 commit comments