<p dir="ltr">Compact OrderedDicts can leave gaps, and once in a while compactify. For example, whenever the entry table is full, it can decide whether to resize (and only copy non-gaps), or just compactactify</p>
<p dir="ltr">Compact regular dicts can swap from the back and have no gaps.</p>
<p dir="ltr">I don't see the point of discussing these details. Isn't it enough to say that these are solvable problems, which we can worry about if/when someone actually decides to sit down and implement compact dicts?</p>
<p dir="ltr">P.S.: Sorry about the repeated emails. I think it was the iOS Gmail app.</p>
<p dir="ltr">On Jun 13, 2016 10:23 PM, "Ethan Furman" <<a href="mailto:ethan@stoneleaf.us">ethan@stoneleaf.us</a>> wrote:<br>
><br>
> On 06/13/2016 05:47 PM, Larry Hastings wrote:<br>
>><br>
>> On 06/13/2016 05:05 PM, MRAB wrote:<br>
><br>
><br>
>>> This could be avoided by expanding the items to include the index of<br>
>>> the 'previous' and 'next' item, so that they could be handled like a<br>
>>> doubly-linked list.<br>
>>><br>
>>> The disadvantage would be that it would use more memory.<br>
>><br>
>><br>
>> Another, easier technique: don't fill holes.  Same disadvantage<br>
>> (increased memory use), but easier to write and maintain.<br>
><br>
><br>
> I hope this is just an academic discussion: suddenly having Python's dicts grow continuously is going to have nasty consequences somewhere.<br>
><br>
> --<br>
> ~Ethan~</p>