[Python-Dev] PEP 487: Simpler customization of class creation (original) (raw)

Guido van Rossum guido at python.org
Tue Jun 21 13🔞50 EDT 2016


On Tue, Jun 21, 2016 at 10:12 AM, Eric Snow <ericsnowcurrently at gmail.com> wrote:

On Mon, Jun 20, 2016 at 12:31 PM, Nikita Nemkin <nikita at 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.

-- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20160621/c6bc743e/attachment.html>



More information about the Python-Dev mailing list