On Tue, Jun 21, 2016 at 3:21 PM, Nick Coghlan <ncogh...@gmail.com> wrote: > 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.
Good point. I'll make a note of this in the PEP. -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