<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 1, 2018 at 5:03 PM, Chris Barker <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="">On Sat, Dec 30, 2017 at 7:27 AM, Stephen J. Turnbull <span dir="ltr"><<a href="mailto:turnbull.stephen.fw@u.tsukuba.ac.jp" target="_blank">turnbull.stephen.fw@u.<wbr>tsukuba.ac.jp</a>></span> wrote:<br></span><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  Just use the simple rule that a new<br>
__repr__ is generated unless provided in the dataclass.<br></blockquote><div><br></div></span><div>are we only talking about __repr__ here ???<br><br></div><div>I interpretted Guido's proposal as being about all methods -- we _may_ want something special for __repr__, but I hope not.<br><br></div><div>But +1 for Guido's proposal, not only because it's easy to explain, but because it more naturally follows the usual inheritance logic:<br><br></div><div>The decorator's entire point is to auto-generate boilerplate code for you. Once it's done that it shouldn't, in the end, behave any differently than if you hand wrote that code. If you hand wrote the methods that the decorator creates for you, they would override any base class versions. So that's what it should do. <br><br></div><div>And the fact that you can optionally tell it not to in some particular case keeps full flexibility.<br><br></div><div>-CHB<br></div></div></div></div></blockquote><div><br></div><div>I interpreted this to be for all methods as well, which makes sense. Special casing just __repr__ doesn't make sense to me, but I will wait for Guido to clarify.<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><span class="">> I grant that there may be many reasons why one would be deriving<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
dataclasses from dataclasses</blockquote><div><br></div></span>Will you get the "right" __repr__ now if you derive a datacalss from a dataclass? That would be a nice feature.<br></div></div></div></blockquote><div><br></div><div>The __repr__ will be generated by the child dataclass unless the user overrides it. So I believe this is the "right" __repr__. <br></div><div><br></div><div>~>Ethan Smith<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"></div><div class="gmail_quote"><div> <br></div><div>-CHB<span class="HOEnZb"><font color="#888888"><br><br></font></span></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_-1043050545373067684gmail_signature" data-smartmail="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            <a href="tel:(206)%20526-6959" value="+12065266959" target="_blank">(206) 526-6959</a>   voice<br>7600 Sand Point Way NE   <a href="tel:(206)%20526-6329" value="+12065266329" target="_blank">(206) 526-6329</a>   fax<br>Seattle, WA  98115       <a href="tel:(206)%20526-6317" value="+12065266317" target="_blank">(206) 526-6317</a>   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ethan%40ethanhs.me" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>ethan%40ethanhs.me</a><br>
<br></blockquote></div><br></div></div>