[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

Serhiy Storchaka report at bugs.python.org
Wed Nov 4 16:09:06 EST 2015


Serhiy Storchaka added the comment:

Thanks for your review Eric.

test_delitem_2 was not added because it fails in just added TestCase for COrderedDict subclass. Added tests for direct calls of other dict methods as Eric suggested.

During writing new tests for direct calls of other dict methods I found yet one bug. Following code makes Python to hang and eat memory.

from collections import OrderedDict
od = OrderedDict()
for i in range(10):
    od[str(i)] = i

for i in range(9):
    dict.__delitem__(od, str(i))

list(od)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24726>
_______________________________________


More information about the Python-bugs-list mailing list