Message305623
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. |
|
Date |
User |
Action |
Args |
2017-11-06 09:38:01 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, tim.peters, rhettinger, methane |
2017-11-06 09:38:01 | serhiy.storchaka | set | messageid: <1509961081.05.0.213398074469.issue31954@psf.upfronthosting.co.za> |
2017-11-06 09:38:00 | serhiy.storchaka | link | issue31954 messages |
2017-11-06 09:38:00 | serhiy.storchaka | create | |
|