News for hackers. Stuff that matters.
Re:Why People Should Learn Python by lmm on Wednesday August 24, 2016 @10:32AM (#12352308)
I find the order of iteration in Python for comprehensions totally confusing every time. If you want to convert:

    for a in x: pass
into a comprehension, you write:

    [pass for a in x]
Simple, right? So to convert

    for a in x: for b in y: pass
I obviously write:

    [pass for b in y for a in x]
Bzzt. Nope, you have to write it in middle-endian order to get the same behaviour.

There are no comments on this comment yet.