[Python-Dev] The current dict is not an "OrderedDict"
Eric Snow
ericsnowcurrently at gmail.com
Tue Nov 14 18:54:15 EST 2017
More information about the Python-Dev mailing list
Tue Nov 14 18:54:15 EST 2017
- Previous message (by thread): [Python-Dev] The current dict is not an "OrderedDict"
- Next message (by thread): [Python-Dev] The current dict is not an "OrderedDict"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Nov 7, 2017 08:12, "INADA Naoki" <songofacandy at gmail.com> wrote: Additionally, class namespace should keep insertion order. It's language spec from 3.6. So we should have two mode for such optimization. It makes dict more complicated. FWIW, PEP 520 (Preserving Class Attribute Definition Order) originally specified leaving the class namespace alone. Instead, the default class *definition* namespace was changed to OrderedDict, and the ordering from that namespace was stored as a tuple of names in a new __definition_order__ attribute on classes. That approach effectively decoupled the final class namespace from the proposed feature. If it's an issue now then we might consider reviving __definition_order__ (which, as a bonus, has other minor benefits). However, I expect we will make the current dict implementation's behavior official, which renders any changes unnecessary. -eric -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20171114/9be1b181/attachment-0001.html>
- Previous message (by thread): [Python-Dev] The current dict is not an "OrderedDict"
- Next message (by thread): [Python-Dev] The current dict is not an "OrderedDict"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list