<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jul 20, 2017 1:13 AM, "David Mertz" <<a href="mailto:mertz@gnosis.cx">mertz@gnosis.cx</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm concerned in the proposal about losing access to type information (i.e. name) in this proposal.  For example, I might write some code like this now:<br><br><font face="monospace, monospace">>>> from collections import namedtuple</font><div><font face="monospace, monospace">>>> Car = namedtuple("Car", "cost hp weight")</font></div><div><font face="monospace, monospace">>>> Motorcycle = namedtuple("Motorcycle", "cost hp weight")</font></div><div><font face="monospace, monospace">>>> smart = Car(18_900, 89, 949)</font></div><div><font face="monospace, monospace">>>> harley = Motorcyle(18_900, 89, 949)</font></div><div><font face="monospace, monospace">>>> if smart==harley and type(smart)==type(harley):</font></div><div><font face="monospace, monospace">...     print("These are identical vehicles")</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">The proposal to define this as:<br><br></font><font face="monospace, monospace">>>> smart = (cost=18_900, hp=89, weight=949)</font></div><div><font face="monospace, monospace">>>> </font><span style="font-family:monospace,monospace">harley = (cost=18_900, hp=89, weight=949)</span></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">Doesn't seem to leave any way to distinguish the objects of different types that happen to have the same fields.  Comparing `</font><font face="monospace, monospace">smart._fields==harley._fields</font><font face="arial, helvetica, sans-serif"><wbr>` doesn't help here, nor does any type constructed solely from the fields.</font></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">What about making a syntax to declare a type? The ones that come to mind are</div><div dir="auto"><br></div><div dir="auto">    name = (x=, y=)</div><div dir="auto"><br></div><div dir="auto">Or</div><div dir="auto"><br></div><div dir="auto">    name = (x=pass, y=pass)</div><div dir="auto"><br></div><div dir="auto">They may not be clear enough, though.</div><div dir="auto"></div></div>