[Python-Dev] Concerns about method overriding and subclassing with dataclasses

Stephen J. Turnbull turnbull.stephen.fw at u.tsukuba.ac.jp
Tue Jan 2 21:11:39 EST 2018


Chris Barker writes:

 > are we only talking about __repr__ here ???

I am, because I haven't thought about the other methods, except to
note I find it hard to imagine a use case *for me* that would require
any of them.  That sorta disqualifies me from comment. ;-)  I assumed
others were talking about all of the dataclass autogenerated methods,
though.

 > And the fact that you can optionally tell it not to in some particular case
 > keeps full flexibility.

AFAICS there is no question about that, just about *how* you indicate
that you do or don't want autobogotification.

 > Will you get the "right" __repr__ now if you derive a datacalss from a
 > dataclass? That would be a nice feature.

I hadn't thought about that: I wouldn't call it "nice", I'd say it's a
sine-qua-back-to-the-drawing-board.



More information about the Python-Dev mailing list