attrs just silently overwrites any user provided __repr__ unless you provide repr=False to attr.s.
I think we can all agree that if nothing else, silently overwriting unconditionally is not what we want for dataclasses. On Fri, Dec 29, 2017 at 4:38 PM, Nathaniel Smith <n...@pobox.com> wrote: > On Fri, Dec 29, 2017 at 12:30 PM, Ethan Furman <et...@stoneleaf.us> wrote: > > Good point. So auto-generate a new __repr__ if: > > > > - one is not provided, and > > - existing __repr__ is either: > > - object.__repr__, or > > - a previous dataclass __repr__ > > > > And if the auto default doesn't work for one's use-case, use the keyword > > parameter to specify what you want. > > What does attrs do here? > > -n > > -- > Nathaniel J. Smith -- https://vorpus.org > _______________________________________________ > 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/ > ethan%40ethanhs.me >
_______________________________________________ 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