<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
For me the current behaviour does not seem unreasonable as it resembles the order in which you write out loops outside a comprehension<br>
</blockquote>
<br>
That's true, but the main reason for having comprehensions<br>
syntax in the first place is so that it can be read<br>
declaratively -- as a description of the list you want,<br>
rather than a step-by-step sequence of instructions for<br>
building it up.<br>
<br>
If you have to stop and mentally transform it into nested<br>
for-statements, that very purpose is undermined.<br></blockquote></span>
Exactly.</blockquote><div><br></div><div>Well, an argument that was often brought up on this forum is that Python should do things consistently, and not in one way in one place and in another way in another place, for the same thing. Here it is about the order of loop execution. The current behaviour in comprehension is that is ts being done the same way as in nested for loops. Which is easy enough to remember. Same way, everywhere.</div><div><br></div><div>-Alexander</div></div></div></div>