[Python-Dev] [RFC] Removing pure Python implementation of OrderedDict

Guido van Rossum guido at python.org
Wed Sep 6 10:36:15 EDT 2017


On Wed, Sep 6, 2017 at 3:49 AM, INADA Naoki <songofacandy at gmail.com> wrote:

> OK, I stop worring about thread safety and other implementation
> detail behavior on edge cases.
>

That sounds like overreacting. At the risk of stating the obvious:

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.)

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.)

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170906/498612d3/attachment.html>


More information about the Python-Dev mailing list