On Nov 7, 2017 08:12, "INADA Naoki" <songofaca...@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
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com