<div class="gmail_quote">On Tue, Feb 17, 2009 at 3:01 PM, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
I think that test_and_add is naturally two operations, not one, and forcing it to be one operation will just lead to confusion.</blockquote><div> </div></div>There is one scenario where testing membership and adding a new member *is* a single operation: multiple threads.<br>
<br>That's a good reason to *not* support a test/change operation in regular sets as it may lead people to think (falsely) that it provide some kind of concurrency protection.<br><br>--- Bruce<br><br><br>