<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 8, 2016 at 11:17 PM, Greg Ewing <span dir="ltr"><<a href="mailto:greg.ewing@canterbury.ac.nz" target="_blank">greg.ewing@canterbury.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">אלעזר wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
class Starship(tuple):<br>
    damage: int = 0      captain: str  = "Kirk"<br>
<br>
Is an obvious syntax for <br>
    Starship = NamedTuple('Starship', [('damage', int), ('captain', str)])<br>
</blockquote>
<br></span>
But the untyped version of that already has a meaning --<br>
it's a tuple subclass with two extra class attributes<br>
that are unrelated to its indexable items.<br>
<br>
I thought that type annotations weren't meant to change<br>
runtime semantics?<span class="HOEnZb"><font color="#888888"></font></span></blockquote><div><br></div><div>Correct, but we can invent a new base class that has these semantics. It's no different from Enum.<br><br></div><div>Anyway, I think this will have to be an add-on to be designed after the basics are done.<br></div></div><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>