<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 14, 2017 at 4:41 PM, MRAB <span dir="ltr"><<a href="mailto:python@mrabarnett.plus.com" target="_blank">python@mrabarnett.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 2017-02-14 21:09, Zachary Ware wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, Feb 14, 2017 at 3:06 PM, Mikhail V <<a href="mailto:mikhailwas@gmail.com" target="_blank">mikhailwas@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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>
</blockquote>
<br>
This is already valid and useful syntax, and thus a non-starter.<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>
0<br>
0<br>
0<br>
8<br>
10<br>
0<br>
18<br>
2<br>
0<br>
10<br>
5<br>
0<br>
0<br>
8<br>
10<br>
0<br>
18<br>
2<br>
0<br>
10<br>
<br>
</blockquote></div></div>
The closest you could get without breaking existing code is [a:b:c]:<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>
What's more, that could be valid outside the 'for' loop too.<br><br></blockquote><div><br></div><div>Guido has already rejected this syntax and several others. <br></div></div></div></div>