Author inada.naoki
Recipients arigo, aronacher, eric.snow, inada.naoki, rhettinger, serhiy.storchaka
Date 2017-09-11.05:59:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1505109567.12.0.8436911544.issue31265@psf.upfronthosting.co.za>
In-reply-to
Content
> Original Raymond's design didn't preserve ordering during deletion.

Original Raymond's pure Python implementation rebuilds index table.
Without it, proving can be very long or infinite loop.
See L89-92 in http://code.activestate.com/recipes/578375/
Strictly speaking, it's worst case is O(n) too.

Raymond's compact dict allocates entry table and index table separately.
I want to allocate them at once, as one memory block.
It makes better cache hit ratio on small dict.

That's why I choose "preserve insertion order" over "compaction".
Since index table and entry table grow at same time, rebuilding
index table and entry table at once makes sense to me.

Anyway, "namespace is ordered" is Python's language spec now.

class C:
    a = 1
    b = 2
    c = 3
    del a

In this case, C's namespace should {"b": 2, "c": 3}, not {"c": 3, "b": 2}.
History
Date User Action Args
2017-09-11 05:59:27inada.naokisetrecipients: + inada.naoki, arigo, rhettinger, aronacher, eric.snow, serhiy.storchaka
2017-09-11 05:59:27inada.naokisetmessageid: <1505109567.12.0.8436911544.issue31265@psf.upfronthosting.co.za>
2017-09-11 05:59:27inada.naokilinkissue31265 messages
2017-09-11 05:59:26inada.naokicreate