C Anthony Risinger wrote:
Erlang/Elixir (sorry after 6 years python this is what I do now!) does it the same way as python:

 >>> [{X, Y} || X <- [1,2,3], Y <- [a,b]].
[{1,a},{1,b},{2,a},{2,b},{3,a},{3,b}]

Here X is the outer loop.

I think the confusion stems from doing it both ways at the same time.

If the semicolon syntax I suggested were available,
you'd be able to choose either order, and maybe even
mix them in the one comprehension. Not sure if that's
a good thing or not...

--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to