This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients methane, rhettinger, serhiy.storchaka, tim.peters
Date 2017-11-06.09:38:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1509961081.05.0.213398074469.issue31954@psf.upfronthosting.co.za>
In-reply-to
Content
Currently OrderedDict uses a table of nodes that mirrors the dict table. For keeping it in sync it saves the size and address of the dict table. There are two issues with this. First, this prevent some kind of dict optimization. When dict is resized (after exhausting usable entries at the end of table) it should allocate a new table even if it's size isn't changed. Second, this doesn't guarantees that both tables are in sync. If the dict table was reallocated twice before using OrderedDict methods, it can have the same size and address, but totally different layout of elements.

Proposed PR adds a new flag to dict object. It is set when OrderedDict creates its table, and is cleared when dict reallocates its table or moves items in the same table.
History
Date User Action Args
2017-11-06 09:38:01serhiy.storchakasetrecipients: + serhiy.storchaka, tim.peters, rhettinger, methane
2017-11-06 09:38:01serhiy.storchakasetmessageid: <1509961081.05.0.213398074469.issue31954@psf.upfronthosting.co.za>
2017-11-06 09:38:00serhiy.storchakalinkissue31954 messages
2017-11-06 09:38:00serhiy.storchakacreate