(original) (raw)
On Tue, Jun 21, 2016 at 10:12 AM, Eric Snow <ericsnowcurrently@gmail.com> wrote:
On Mon, Jun 20, 2016 at 12:31 PM, Nikita Nemkin <nikita@nemkin.ru> wrote:
\> Right. Ordered by default is a very serious implementation constraint.
\> It's only superior in a sense that it completely subsumes/obsoletes
\> PEP 520.
Just to be clear, PEP 520 is more than just OrderedDict-by-default.
In fact, the key point is preserving the definition order, which the
PEP now reflects better. Raymond's compact dict would only provide
the ordered-by-default part and does nothing to persist the definition
order like the PEP specifies.
Judging from Inada's message there seems to be some confusion about how well the compact dict preserves order (personally I think if it doesn't guarantee order after deletions it's pretty useless).
Assuming it preserves order across deletions/compactions (like IIUC OrderedDict does) isn't that good enough for any of the use cases considered? It would require a delete+insert to change an item's order. If we had had these semantics in the language from the start, there would have been plenty uses of this order, and I suspect nobody would have considered asking for \_\_definition\_order\_\_.