On 20 June 2016 at 19:11, Eric Snow <ericsnowcurren...@gmail.com> wrote: > FWIW, regarding repercussions, I do not expect any other potential > future feature will subsume the functionality of PEP 520. The closest > thing would be if cls.__dict__ became ordered. However, that would > intersect with __definition_order__ only at first. Furthermore, > cls.__dict__ would only ever be able to make vague promises about any > relationship with the definiton order. The point of > __definiton_order__ is to provide the one obvious place to get a > specific bit of information about a class.
It occurs to me that a settable __definition_order__ provides a benefit that an ordered tp_dict doesn't: to get the "right" definition order in something like Cython or dynamic type creation, you don't need to carefully craft the order in which attributes are defined, you just need to set __definition_order__ appropriately. It also means that the "include dunder-attributes or not" decision is easy to override, regardless of what we set as the default. By contrast, if the *only* ordering information is cls.__dict__.keys(), then there's no way for a type implementor to hide implementation details. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ 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