Serhiy Storchaka added the comment: An OrderedDict owns two references to every key (as a dict and from a linked list). Therefore it should visit it twice in tp_traverse.
Proposed patch fixes garbage collection for OrderedDict. It also rewrites OrderedDict clearing in more reentrant form (a linked list is detached from an OrderedDict before deallocating its nodes that can trigger executing user code). ---------- keywords: +patch stage: -> patch review versions: +Python 3.6 Added file: http://bugs.python.org/file41441/odict_traverse.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25935> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com