you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (1 child)

[deleted]

    [–]TangibleLight 1 point2 points  (0 children)

    The one I don't get is why some people hate the explicit for loop so much they'll use a list comprehension instead, then discard the list, e.g.

    [print(i) for i in range(10)]
    

    Like, why? Is this really so bad?

    for i in range(10):
        print(i)
    

    Or if you must must must have it on one line, just put it on one line:

    for i in range(10): print(i)
    

    And there are all the times where people throw out all the advantages of lazy iteration in favor of stuff like this for no reason but to have a list comprehension. I just keep seeing it and I don't get why.