<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 5, 2018 at 5:08 AM, Eric V. Smith <span dir="ltr"><<a href="mailto:eric@trueblade.com" target="_blank">eric@trueblade.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 1/2/2018 12:01 AM, Guido van Rossum wrote:<span class="gmail-"></span><br><span class="gmail-"></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
Yes, there's a class variable (__dataclass_fields__) that identifies the parent fields. The PEP doesn't mention this or the fact that special methods (like __repr__ and __init__) can tell whether a base class is a dataclass. It probably should though. (@Eric)<br>
</span></blockquote>
<br>
I think that's covered in this section: <a href="https://www.python.org/dev/peps/pep-0557/#inheritance" rel="noreferrer" target="_blank">https://www.python.org/dev/pep<wbr>s/pep-0557/#inheritance</a><span class="gmail-HOEnZb"><font color="#888888"></font></span><br></blockquote></div><br clear="all"></div><div class="gmail_extra">I was specifically talking about the name and contents of <span class="gmail-">__dataclass_fields__, which are not documented by the PEP. I expect it's inevitable that people will be looking at this (since they can see it in the source code). Or do you recommend that people use dataclasses.fields() and catch ValueError? I notice that _isdataclass() exists but is private and I don't recall why. (Also now I'm curious what the "pseudo-fields" are that fields() ignores, but that's OT.)<br></span></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>