<div dir="ltr">I would be surprised if this hasn't been suggested many times before. It's similar to Matlab's syntax:<br><br><font face="monospace, monospace">for x = start:step:finish</font><div><font face="monospace, monospace">    <do whatever><br>end<br></font><br>Any such change would represent a large departure from normal python syntax for dubious gain. In general, you can put any expression after the `in` keyword so long as it evaluates to an iterable or an iterator. Your specific proposal would break some perfectly valid code.<br><br>You could likely come up with some symbols that couldn't show up in existing code, but it's usually better to use words instead of obscure symbol notation to preserve the readability of Python rather than letting it devolve into a concise, yet unreadable soup of symbols like Perl.<br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 14, 2017 at 3:06 PM, Mikhail V <span dir="ltr"><<a href="mailto:mikhailwas@gmail.com" target="_blank">mikhailwas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I have a small syntax idea.<br>In short, contraction of <br><br>for x in range(a,b,c) :<br><br>to<br><br>for x in a,b,c :<br><br>I really think there is something cute in it.<br>So like a shortcut for range() which works only in for-in statement. <br>So from syntactical POV, do you find it nice syntax?<br>Visually it seems to me less bulky than range().<br><br>Example:<br><br>for x in 0,5 :<br>    print (x)<br>    for y in 0,10,2 :<br>        print (y)<br>        for z in 0, y+8 :<br>            print (z)<br><br>Which would be short for:<br><br>for x in range(0,5):<br>    print (x)<br>    for y in range(0,10,2):<br>        print (y)<br>        for z in range(0, y+8):<br>            print (z)<span class="HOEnZb"><font color="#888888"><br><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Mikhail<br></font></span></div>
<br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br></blockquote></div><br></div>