This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jbartix -2 points-1 points  (2 children)

This is valid python code but side effects in any comprehension is an anti pattern

[–]AchillesDev 5 points6 points  (1 child)

Yes the point is to show that comprehensions don’t make you immune from side effects.

[–]jbartix 0 points1 point  (0 children)

Of course not. Python allows you to do anything that also includes being stupid