Currently, if you want to implement a method yourself, you have to remember to do two things:
@attr.s(repr=False)
class C:
def __repr__(self):
return "whatever"
I’ve seen quite a few people be confused/frustrated by that.
I think unless these is set, it would be kind of cool if we detected that the current class (and not some super class) has a user-written method and set the flag to false automatically such that
@attr.s
class C:
def __repr__(self):
return "whatever"
does what you’d expect.
Opinions?
Currently, if you want to implement a method yourself, you have to remember to do two things:
I’ve seen quite a few people be confused/frustrated by that.
I think unless
theseis set, it would be kind of cool if we detected that the current class (and not some super class) has a user-written method and set the flag to false automatically such thatdoes what you’d expect.
Opinions?