I’m traveling until next week, and haven’t had time to read any of these emails. I’ll look at them when I return.
-- Eric. > On Dec 30, 2017, at 5:20 AM, Raymond Hettinger <raymond.hettin...@gmail.com> > wrote: > > >> On Dec 29, 2017, at 4:52 PM, Guido van Rossum <gu...@python.org> wrote: >> >> I still think it should overrides anything that's just inherited but nothing >> that's defined in the class being decorated. > > This has the virtue of being easy to explain, and it will help with debugging > by honoring the code proximate to the decorator :-) > > For what it is worth, the functools.total_ordering class decorator does > something similar -- though not exactly the same. A root comparison method > is considered user-specified if it is different than the default method > provided by object: > > def total_ordering(cls): > """Class decorator that fills in missing ordering methods""" > # Find user-defined comparisons (not those inherited from object). > roots = {op for op in _convert if getattr(cls, op, None) is not > getattr(object, op, None)} > ... > > The @dataclass decorator has a much broader mandate and we have almost no > experience with it, so it is hard to know what legitimate use cases will > arise. > > > Raymond > > _______________________________________________ > 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/eric%2Ba-python-dev%40trueblade.com _______________________________________________ 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