<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Sep 6, 2017 at 3:49 AM, INADA Naoki <span dir="ltr"><<a href="mailto:songofacandy@gmail.com" target="_blank">songofacandy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OK, I stop worring about thread safety and other implementation<br>
detail behavior on edge cases.<br></blockquote><div><br></div><div>That sounds like overreacting. At the risk of stating the obvious:</div><div><br></div><div>I want the data structure itself to maintain its integrity even under edge cases of multi-threading. However that's different from promising that all (or certain) operations will be atomic in all cases. (Plus, for dicts and sets and other data structures that compare items, you can't have atomicity if those comparisons call back into Python -- so it's extra important that even when that happens the data structure's *integrity* is still maintained.)</div><div><br></div><div>IMO, in edge cases, it's okay to not do an operation, do it twice, get the wrong answer, or raise an exception, as long as the data structure's internal constraints are still satisfied (e.g. no dangling pointers, no inconsistent indexes, that sort of stuff.)<br></div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>