(original) (raw)

On Fri, Dec 29, 2017 at 7:10 AM, Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
Recently a question has been raised about the decorator overriding
methods defined in the class (especially \_\_repr\_\_). People feel that
if the class defines a method, the decorator should not override it.
The current API requires passing "repr=false" to the decorator.

I think this is a reasonable question, though I'm not sure how "big" it is. Note that if the \*base\* class defines \_\_repr\_\_ the decorator should still override it (unless repr=False), since there's always object.\_\_repr\_\_ (and same for most other dunders). We should also (like we did with most questions big and small) look at what attrs does and why.

Regarding whether this should live on PyPI first, in this case that would not be helpful, since attrs is already the category killer on PyPI. So we are IMO taking the best course possible given that we want something in the stdlib but not exactly attrs.

--
--Guido van Rossum (python.org/\~guido)