<div>Sorry, this one shouldn't be "an"; " a" was correct::</div><div><br></div><div> ``repr``: If true (the default), an ``__repr__`` method will be generated.</div><div><br></div><div>Note that __repr__ can be dangerous with user-supplied input because of terminal control character injection (e.g. broken syntax highlighting, \r, character set, LEDs,)</div><br>On Thursday, November 30, 2017, Wes Turner <<a href="mailto:wes.turner@gmail.com">wes.turner@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Could these be things in types?<div><br></div><div>types.ClassType</div><div>types.InstanceType</div><div><br></div><div>types.DataClass</div><div>types.DataClassInstanceType (?)</div><div><br></div><div>I sent a PR with typo fixes and ``.. code:: python`` directives so that syntax highlighting works (at least on GitHub).</div><div><br></div><div><a href="https://github.com/python/peps/blob/master/pep-0557.rst" target="_blank">https://github.com/python/<wbr>peps/blob/master/pep-0557.rst</a><br></div><div><br></div><div><a href="https://github.com/python/peps/pull/488" target="_blank">https://github.com/python/<wbr>peps/pull/488</a><br></div><div><br></div><div>Additional notes:</div><div><br></div><div>- "DataClass" instead of "Data Class" would be easier to search for. s/DataClass/Data Class/g?</div><div>- It's probably worth mentioning how hash works when frozen=True also here:</div><div> <a href="https://github.com/python/peps/blob/master/pep-0557.rst#frozen-instances" target="_blank">https://github.com/python/<wbr>peps/blob/master/pep-0557.rst#<wbr>frozen-instances</a></div><div>- The `hash` explanation could be a two column table for easier readability</div><div><br></div><div>What a great feature.</div><div><br></div><div>- Runtime data validation from annotations (like PyContracts,) would be cool</div><div>- __slots__ are worth the time<br><br>On Thursday, November 30, 2017, Antoine Pitrou <<a href="javascript:_e(%7B%7D,'cvml','solipsis@pitrou.net');" target="_blank">solipsis@pitrou.net</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
isdataclass() testing for instance-ship does sound like a bug magnet to<br>
me.<br>
<br>
If isdataclassinstance() is too long (that's understandable), how about<br>
isdatainstance()?<br>
<br>
Regards<br>
<br>
Antoine.<br>
<br>
<br>
On Wed, 29 Nov 2017 17:02:21 -0800<br>
Guido van Rossum <<a>guido@python.org</a>> wrote:<br>
> On Wed, Nov 29, 2017 at 3:51 PM, Carl Meyer <<a>carl@oddbird.net</a>> wrote:<br>
><br>
> > 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/" target="_blank">https://www.python.org/dev/pep<wbr>s/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>
> > 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.<br>
> ><br>
><br>
> I tried to look up the discussion but didn't find much except that you<br>
> flagged this as an issue. To repeat, your concern is that isdataclass()<br>
> applies to *instances*, not classes, which is how Eric has designed it, but<br>
> you worry that either through the name or just because people don't read<br>
> the docs it will be confusing. What do you suppose we do? I think making it<br>
> work for classes as well as for instances would cause another category of<br>
> bugs (confusion between cases where a class is needed vs. an instance<br>
> abound in other situations -- we don't want to add to that). Maybe it<br>
> should raise TypeError when passed a class (unless its metaclass is a<br>
> dataclass)? Maybe it should be renamed to isdataclassinstance()? That's a<br>
> mouthful, but I don't know how common the need to call this is, and people<br>
> who call it a lot can define their own shorter alias.<br>
><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a>Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/wes.turner%40gmail.com" target="_blank">https://mail.python.org/mailma<wbr>n/options/python-dev/wes.<wbr>turner%40gmail.com</a><br>
</blockquote></div>
</blockquote>