On Thu, Jun 9, 2016 at 2:39 PM, Nick Coghlan <ncogh...@gmail.com> wrote: > I'm guessing Ethan is suggesting defining it as: > > __definition_order__ = tuple(ns["__definition_order__"]) > > When the attribute is present in the method body.
Ah. I'd rather stick to "consenting adults" in the case that __definition_order__ is explicitly set. We'll strongly recommend setting it to None or a tuple of identifier strings. > > That restriction would be comparable to what we do with __slots__ today: > > >>> class C: > ... __slots__ = 1 > ... > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > TypeError: 'int' object is not iterable Are you suggesting that we require it be a tuple of identifiers (or None) and raise TypeError otherwise, similar to __slots__? The difference is that __slots__ has specific type requirements that do not apply to __definition_order__, as well as a different purpose. __definition_order__ is about preserving definition-type info that we are currently throwing away. -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