A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-September/149152.html below:

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

[Python-Dev] [RFC] Removing pure Python implementation of OrderedDict [Python-Dev] [RFC] Removing pure Python implementation of OrderedDictINADA Naoki songofacandy at gmail.com
Tue Sep 5 09:19:18 EDT 2017
On Tue, Sep 5, 2017 at 8:48 PM, Serhiy Storchaka <storchaka at gmail.com> wrote:
> 05.09.17 11:38, INADA Naoki пише:
>>
>> ## Cons
>>
>> * All Python 3.7 implementations should provide _collections.OrderedDict
>>    PyPy has it already.  But I don't know about micropython.
>
>
> Current C implementation of OrderedDict is not safe regarding using mutating
> dict methods (or dict C API) like dict.__setitem__ or PyDict_SetItem. Using
> them can cause hangs or segfaults. See issue24726 and issue25410. I hope
> your implementation will solve these issues, but there may be others.

Thanks for sharing these issues.
My pull request is still early stage and may have some bugs.
But I think it will solve many of issues because most odd behaviors comes from
difficult of consistency between linked list and dict.

> While
> the C implementation still is not enough mature, we should allow users that
> encountered one of such issues to use pure Python implementation which is
> free from hangs and segfaults.
>

I see.
Maybe, we can move Pure Python OrderedDict to collections._odict module,
and collections/__init__.py can be like this:

    from _collections import OrderedDict
    # Pure Python implementation can be used when C implementation
cause segfault.
    # from collections._odict import OrderedDict


> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/songofacandy%40gmail.com
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4