<p dir="ltr"><br>
On Aug 15, 2014 2:55 PM, "Łukasz Langa" <<a href="mailto:lukasz@langa.pl">lukasz@langa.pl</a>> wrote:<br>
><br>
> On Aug 15, 2014, at 11:43 AM, Sunjay Varma <<a href="mailto:varma.sunjay@gmail.com">varma.sunjay@gmail.com</a>> wrote:<br>
>><br>
>> Hi all,<br>
>> Has the syntax for specifying type been fully decided on already?<br>
>><br>
>> Using brackets may confuse new Python programmers. (…) Other languages use angle brackets to specify types.<br>
><br>
><br>
> I also agree that angle brackets would be nicer. Guido decided against it for pragmatic reasons:<br>
> 1. angle brackets would create Python source code incompatible with any version lower than 3.5</p>
<p dir="ltr">I'm all for compatibility, but Python 3 already breaks compatibility with Python 2. Why not add this feature in Python 4 (or whatever the next breaking release is) and do it "right" the first time. I don't think it makes sense to start muddling up the different semantic meanings of Python's operations just because we think it will break in an older version. </p>
<p dir="ltr">This is such a big and important change. It deserves its own syntax (and if necessary a new version number as well).</p>
<p dir="ltr">> 2. angle brackets would complicate the lexer (normally you expect < and > to be spaced, in this case it wouldn’t)<br>
> 3. angle brackets would require a new mechanism in Python to store this kind of expression within the type; this is still true for generics expressed with square brackets but at least you can use the existing nuts and bolts of Python classes<br>
</p>
<p dir="ltr">Angle brackets were just a suggestion as they are used frequently by other languages. Even braces would be more appropriate as they're already built into the lexer and dict{int, str} clearly means something different than dict[int, str].<br>
</p>
<p dir="ltr">><br>
> All in all, this is more trouble than it’s worth.</p>
<p dir="ltr">I can understand that it's easier to use what's already there, but I don't agree with doing something just because it's easier. Especially when the side effects are not at all appealing.</p>
<p dir="ltr">Sunjay<br>
</p>