<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"> On Wed, Nov 29, 2017 at 3:51 PM, Carl Meyer <span dir="ltr"><<a href="mailto:carl@oddbird.net" target="_blank">carl@oddbird.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 11/29/2017 03:26 PM, Eric V. Smith wrote:<br>
> I've posted a new version of PEP 557, it should soon be available at<br>
> <a href="https://www.python.org/dev/peps/pep-0557/" rel="noreferrer" target="_blank">https://www.python.org/dev/<wbr>peps/pep-0557/</a>.<br>
><br>
> The only significant changes since the last version are:<br>
><br>
> - changing the "compare" parameter to be "order", since that more<br>
> accurately reflects what it does.<br>
> - Having the combination of "eq=False" and "order=True" raise an<br>
> exception instead of silently changing eq to True.<br>
><br>
> There were no other issues raised with the previous version of the PEP.<br>
<br>
</span>Not quite; I also raised the issue of isdataclass(ADataClass) returning<br>
False. I still think that's likely to be a cause of bug reports if left<br>
as-is.<span class="HOEnZb"></span><br></blockquote></div><br clear="all"></div><div class="gmail_extra">I tried to look up the discussion but didn't find much except that you flagged this as an issue. To repeat, your concern is that isdataclass() applies to *instances*, not classes, which is how Eric has designed it, but you worry that either through the name or just because people don't read the docs it will be confusing. What do you suppose we do? I think making it work for classes as well as for instances would cause another category of bugs (confusion between cases where a class is needed vs. an instance abound in other situations -- we don't want to add to that). Maybe it should raise TypeError when passed a class (unless its metaclass is a dataclass)? Maybe it should be renamed to isdataclassinstance()? That's a mouthful, but I don't know how common the need to call this is, and people who call it a lot can define their own shorter alias.<br></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>